Tag: MongoDB
PreambleMongoDB Conditional operators specify a condition to which the value of the document field shall correspond.Comparison Query Operators $eq (equal)$ne (not equal)$gt (more than)$lt (less...
FlexibilityOne of the most advertised features of MongoDB is its flexibility. Flexibility, however, is a double-edged sword. More flexibility means more choices when modeling data (this reminds...
PreambleMongoDB recently introduced its new aggregation structure. This structure provides a simpler solution for calculating aggregated values rather than relying on powerful structures with a...
PreambleAtom Hopper (based on Apache Abdera) for those who may not know is an open-source project sponsored by Rackspace. Today we will figure out how to use the new MongoDB data adapter.After...
First the basics: what is the master/slave?One database server (“master”) responds and can do anything. A lot of other database servers store copies of all the data that have been written to the...
PreambleWriting an application on top of the framework on top of the driver on top of the database is a bit like a game on the phone: you say “insert foo”, and the database says...
PreambleExternal keys may be set in relational databases when fields from one table refer to fields in another table. You can also set links in MongoDB.Manual link settingThe manual setting of...
PreambleWhen searching for documents in small collections, we won’t have any special problems. However, when collections contain millions of documents, and we need to sample them by a certain...
PreambleIn the previous topics, the collection was created implicitly automatically when the first data were added to it. But we can also create it explicitly by using the db.createCollection(name,...
PreambleThe MongoClient class is used to connect to the mongodb database. It allows you to connect to mongodb (connect method) and disconnect (close method), as well as select the database (selectDB...
PreambleWhen you need to select a DBMS, the main question is usually to select a relational (SQL) or non-relational (NoSQL) structure. Both options have their advantages, as well as several key...
Like other database management systems, MongoDB provides an opportunity to update data. The easiest to use method is to save. This method accepts a document as a parameter. Method of saving The...
MongoDB grouping commands: count, group, distinct should be considered separately. Number of items in the collection With the count() function you can get the number of elements in the...
The easiest way to get the database content is to use the find function. The action of this function is largely similar to the usual SELECT * FROM Table query, which extracts all strings. For...
PreambleMongoDB has a removal method to remove documents:db.users.remove({name : "Tom"})The remove() method returns the WriteResult object. If one document is deleted successfully, the result is the...
MongoDB Documentation - There are several methods to update Document in MongoDB:updateOne: refreshes one document that meets the filtering criteria and returns information about the update...