Answer the question
In order to leave comments, you need to log in
DB structure for the project?
Hello!
I am slowly learning Mongo. Educational project, news aggregator.
Let's say several rss channels, we take the news for each channel and put it in Mongo, then we show it on the client in a human-readable form.
In view of my little development experience, please tell me how to properly design the database structure for this?
I understand that it should look something like this:
one collection, there are documents
{tit: title, desc: description, items: [{title: title, body: news body, date: pubDate}, {title: title, body: news body, date: pubDate}, ....]}
Answer the question
In order to leave comments, you need to log in
MongoDB - flexible scheme data base (which practically means structureless). And you somehow misunderstand the collection - {tit: title, desc: description, items: ...
- not a collection, but a document in the collection (news - other documents are embedded in it). It's perfectly fine for crud to use _id: . In general, enjoy all the benefits of the 21st century, especially ODM (ORM for nosql).
Why schemas for a schemaless database? Actually, this is the plus of noSQL solutions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question