chatAdmin | Helps with administration of chats | Bot library
kandi X-RAY | chatAdmin Summary
kandi X-RAY | chatAdmin Summary
Example-bot works in t.me/progersuz.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of chatAdmin
chatAdmin Key Features
chatAdmin Examples and Code Snippets
Community Discussions
Trending Discussions on chatAdmin
QUESTION
I am quite new in mongodb.I have a collection named message which contains a field name usrId. This field can reference to a student or to an admin. so I join 3 tables of message and student and chatAdmin to find out this message is sent from whom.
But the thing is,I do not want 2 seperate object in the result fields.I just want to have one user object containing student or admin .because the message is only from one of them.
message collection :
...ANSWER
Answered 2019-Feb-25 at 13:41You should consider your design. MongoDB is not a relational database, therefore you don't have tables, and you would usually want to avoid joins as a main pattern, especially when you have large data.
It's better if you read about denormalization of NoSQL databases. For example, it's better to have both students and admins in the same collection. And even better not to make joins, but to embed their data or a brief information, that is enough for you in most of the cases, inside the messages collection. It's a duplication, but you earn low latency, and that's what NoSQL databases are all about. Also, you might consider a conventional relational database.
That be said, for the sake of learning, you can do something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install chatAdmin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page