MongoDB Scheme

42 views
Skip to first unread message

Sergio Perez

unread,
Nov 6, 2019, 3:53:19 PM11/6/19
to mongodb-user
Someone who wants to help me to improve this simulator that uses MongoDB.


I use two collections, telephones and messages, but I have some doubts about collection telephones, I create two documents for each communicationId:

{communicationId: '9a150a30-d8e4-4b4b-9f1c-01bb4205ab02', telephone:'666666001', telephoneTo: '666666002', description:'Robert Hooke', date: ISODate('2019-10-08T11:50:42.389Z')},
{communicationId: '9a150a30-d8e4-4b4b-9f1c-01bb4205ab02', telephone:'666666002', telephoneTo: '666666001', description:'Isaac Newton', date: ISODate('2019-10-08T11:50:42.389Z')}

But I need to differentiate telephone From and To.

Ming Chen

unread,
Nov 14, 2019, 12:19:22 AM11/14/19
to mongodb-user

Hi Sergio,


Unfortunately there is not enough information from your question to answer. Could you please elaborate the issue by providing the following information:

  • The issue with your current schema
  • Example code/query to reproduce the issue
  • The desired outcome that you would like to achieve

I'd recommend to enrol in MongoDB University course "M320: Data Modeling", which contains great information on MongoDB schema design. 


Regards,

Ming
Reply all
Reply to author
Forward
0 new messages