Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Actor prop author not found on model instance #35

Description

@emmanuelAjako

here's my code
`export const ArticleSchema = new Schema(
{
slug: {type: String, lowercase: true, unique: true},
title: {
type: String,
required: true,
},
body: {
type: String,
required: true,
},
description: {
type: String,
},
likes: {type: Number, default: 0},
tagList: [{ type: String}],
author:{ type: mongoose.Schema.Types.ObjectId, ref: 'User',
autopopulate:true
},
comments: [{
body:{ type: String, maxlength: 280},
commenter: { type: mongoose.Schema.Types.ObjectId, ref: "User", autopopulate:true},
commentedAt:Date,
replies:[{
reply:{ type: String, default: "", maxlength: 280},
replyAuthor:{type:mongoose.Schema.Types.ObjectId, ref:'User'}
}]
}],
}
);
ArticleSchema.plugin(stream.mongoose.activity);

ArticleSchema.methods.activityActorProp = function() {
return 'author';
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions