javascript - How to Query two tables together in MongoDB with both columns present? -
i met stumbling block while doing join statement mongo db. have 2 different tables show below
- user table (
_id
,username
) - message table (
user_id
)
i trying fetch messages alongside username
of user posted message.
output
{ "msg":[ { "_id":"599a2ca773905b2787cb91c8", "user_id":"5997da7868f45f39206f703d", "topic_id":0,"message":"hello black_man", "datecreated":"2017-08-21t00:43:19.000z", "__v":0, "user_messages":[] }, ] }
it not seems have values inside user_message
believe should contact corresponding user details.
please kindly this.
thanks...
wiki
Comments
Post a Comment