Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "_id" : ObjectId("5a8ea03d2601be24b086ccd4"),
- "userId" : 20,
- "text" : "Hi",
- "__v" : 0
- }
- {
- "_id" : ObjectId("5a8ea03d2601be24b086ccd4"),
- "userId" : 20,
- "voice" : "d2601be24bd22601be24b",
- "__v" : 0
- }
- Message
- .find({userId: '20'}, {_id: 0, text: ''})
- .exec((err, obj) => {
- if (err) {
- console.log(err);
- }
- for (const val of Object.values(obj)) {
- console.log(val.text);
- }
- });
- Hi // for text
- undefined // for voice
Add Comment
Please, Sign In to add comment