Cassandra vs MongoDB

Difference between cassandra and mongodb. Below is the comparative study between Cassandra and MongoDB.   CASSANDRA MONGODB Written in Java. Written in C++. It is a NoSQL Database or a non relational database. It is also a NoSQL Database or a non relational database. It is a distributed database system MongoDB is a document oriented … Read more

Mongodb sort query

In MongoDB, we can manually sort the documents in a collection in the selected database using db.collection_name.find().sort() method. Type the command collection_name.find() in the command prompt to see all the inserted document in a collection. For Example: db.HELLO.find() Type the command collection_name.find().sort({KEY: 1}) in the command prompt to sort all the inserted documents in a … Read more

Mongodb query limit fields

MongoDB limit() :  In MongoDB, we can manually limit the fields of document that we want to retrieve from a collection in the selected database using db.collection_name.find().limit(Number) method. Type the command use DATABASE_NAME in the command prompt to create a new database or to select the already created database with the respective name. For Example: … Read more

Mongodb query documents

In MongoDB, we can manually retrieve a document from a collection in the selected database using db.collection_name.find() method. Type the command use DATABASE_NAME in the command prompt to create a new database or to select the already created database with the respective name. For Example: use Hellodb Type the command createCollection(name, options) in the command … Read more

Mongodb delete documents

In MongoDB, we can manually delete a document from a collection in the selected database using db.collection_name.remove() method. Type the command use DATABASE_NAME in the command prompt to create a new database or to select the already created database with the respective name. For Example: use Hellodb Type the command createCollection(name, options) in the command … Read more

Mongodb update documents

In MongoDB, we can insert a document using the upsert method into a collection, or we can update or modify the existing documents of a collection in the selected database using db.collection_name.update() method in MongoDB. Type the command use DATABASE_NAME in the command prompt to create a new database or to select the already created … Read more

Mongodb insert document

In MongoDB, we can manually insert a document into a collection in the selected database using db.collection_name.insert() method. We can also insert a document using the upsert method into a collection in the selected database using db.collection_name.update() or db.collection_name.save() method in MongoDB. Type the command use DATABASE_NAME in the command prompt to create a new … Read more

MongoDB Drop collection

In MongoDB, we can manually drop a collection to completely delete a collection from a database using db.collection_name.drop() method. Type the command use DATABASE_NAME in the command prompt to create a new database or to select the already created database with the respective name. For Example: use Hellodb Type the command show collections in the … Read more

MongoDB Create Collection

Creating a collection is an automatic task in MongoDB. This is a distinguished feature in MongoDB, where a collection is automatically created when when we insert some documents. However in MongoDB, we can also create a collection manually, using the command db.createCollection. Type the command use DATABASE_NAME in the command prompt to create a new … Read more

MongoDB Drop Database

In MongoDB, we can manually drop a database to delete the associated data files of the current database using dropDatabase command. Type the command use DATABASE_NAME in the command prompt to create a new database or to select the already created database with the respective name. For Example: use Hellodb Type the command dropDatabase() in … Read more