You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
...
comments: [ {type: Schema.Types.ObjectId, ref: 'Comment'}] //array of ref to comment
...
and the populate schema in the feather hook
const populateCommentSchema = {
include: [
service: 'comments',
nameAs: 'comments',
parentField: 'comments', //the field in the Post schema
childField: '_id' //the field in the Comment schema
]
};
Steps to reproduce
Here is my post schema in mongodb :
and the populate schema in the feather hook
The post hook object:
Expected behavior
when I try to populate
Comments
when callingfind
service method , the result should contain an array of Comments.Actual behavior
But if the
Post
have just one ref ofComment
in the array, the result ofcomments
is just one object.Did I made the wrong populate schema ? or something I missed along the way ? Please point me out.
Thank you very much.
The text was updated successfully, but these errors were encountered: