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

Actor prop author not found on model instance #35

Open
emmanuelAjako opened this issue Dec 26, 2018 · 0 comments
Open

Actor prop author not found on model instance #35

emmanuelAjako opened this issue Dec 26, 2018 · 0 comments

Comments

@emmanuelAjako
Copy link

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';
}`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant