Hot answers tagged

3

The only real questions to mainly be considered when choosing between NoSQL and a Relational Database Management System (RDBMS) are: "Does the data have a well defined structure or is it very unstructured / variable in structure?" "Are the questions I need to ask of the data always simple?" And less important but valid: "Do I need ...


2

Should be this one: mongorestore --nsInclude="PetHotel.*" --nsFrom='PetHotel.*' --nsTo='PetHouse.*' dump/ mongorestore --nsInclude='*.*' --nsFrom='$database$.*' --nsTo='$database$2.*' dump/ First test it with option --dryRun See Change Collections' Namespaces during Restore


2

While the accepted answer is correct in that $group stage will not preserver order, I think it left some important information out and can be misleading. If you look at the comments on the Jira Ticket linked it clears it up there to. Basically it says that $group maintains the order within the 'groups' but order will not be guaranteed for stages after the ...


1

Yes, it is not a good idea to use a dynamic (changing value) like an ObjectId as a field name. To query a specific bookmark you are looking for a specific value for a specific field. And also, to index bookmarks fields it is not possible as the field names are changing. You can use something like this, for the bookmarks field: bookmarks: [ { post_id: &...


1

Yes, a write to a single instance, distributed database will be immediately consistent. You likely still won't have ACID, as each NoSQL variant has its own ways of handling (or not) atomicity. Although, I have to wonder what the goal would be here. The main feature of a NoSQL database is its ability to support partition tolerance...which is lost in a ...


1

Wernfried Domscheit said: You don't need to copy any data in a replicat set. Just remove entire directory and start the service. The replicat set will trigger an inital sync and copies all data. In case you like to take a copy from dbPath you should stop the service or at least lock it with db.fsyncLock() (and of course unlock afterwards with db.fsyncUnlock(...


1

Consider using Percona tool if you are using MongoDB version above 3.6. Taking dump of individual shards and trying to stitch it together while restoring is not advisable.


Only top voted, non community-wiki answers of a minimum length are eligible