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

  1. user table (_id, username)
  2. 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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -