diff --git a/dummy/post.dummy.js b/dummy/post.dummy.js index 3c53601..1666526 100644 --- a/dummy/post.dummy.js +++ b/dummy/post.dummy.js @@ -3,7 +3,7 @@ const dummy = require('mongoose-dummy') const ignoredFields = ['_id', '__v', /detail.*_info/] const Schema = mongoose.Schema let schemaDefinition = new mongoose.Schema({ - user: { + postedBy: { type: Schema.Types.ObjectId, ref: 'User', }, @@ -45,18 +45,18 @@ let randomObject = dummy(model, { ignore: ignoredFields, returnDate: true, }) -console.log(randomObject) +console.log(JSON.stringify(randomObject)) - // { - // "user": "614f82e9fd606f98221f63f0", - // "title": "Javier.Bode", - // "votes": 7, - // "photoUrl": "Ophelia53", - // "videoUrl": "Julio40", - // "category": "Danial78", - // "comments": [ - // "614f82e9fd606f98221f63f0", - // ], - // "createdOn": "2021-09-25T01:43:14.750Z", - // "decription": "Brenden81" - // } +// { +// "user": "614f82e9fd606f98221f63f0", +// "title": "Javier.Bode", +// "votes": 7, +// "photoUrl": "Ophelia53", +// "videoUrl": "Julio40", +// "category": "Danial78", +// "comments": [ +// "614f82e9fd606f98221f63f0", +// ], +// "createdOn": "2021-09-25T01:43:14.750Z", +// "decription": "Brenden81" +// }