- MongoEngine - Discussion
- MongoEngine - Useful Resources
- MongoEngine - Quick Guide
- MongoEngine - Extensions
- MongoEngine - Text Search
- MongoEngine - Signals
- MongoEngine - GridFS
- MongoEngine - Javascript
- MongoEngine - Atomic Updates
- MongoEngine - Document Inheritance
- MongoEngine - Advanced Queries
- MongoEngine - Aggregation
- MongoEngine - Indexes
- MongoEngine - Custom Query Sets
- MongoEngine - Sorting
- MongoEngine - QuerySet Methods
- MongoEngine - Query Operators
- MongoEngine - Filters
- MongoEngine - Querying Database
- MongoEngine - Add/Delete Document
- MongoEngine - Fields
- MongoEngine - Dynamic Schema
- MongoEngine - Document Class
- MongoEngine - Connecting to MongoDB Database
- MongoEngine - Installation
- MongoEngine - Object Document Mapper
- MongoEngine - MongoDB Compass
- MongoEngine - MongoDB
- MongoEngine - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MongoEngine - MongoDB Compass
MongoDB has also developed a GUI tool for handpng MongoDB databases. It is called MongoDB Compass. It is a convenient tool for performing all CRUD operations without manually writing queries. It helps in many activities such as indexing, document vapdation, etc.
Download community edition of MongoDB Compass from
and start MongoDBCompassCommunity.exe (Ensure that MongoDB server is running before starting Compass). Connect to the local server by giving correct host and port number.All the databases currently available will be psted as below −
Cpck on + button (shown at the bottom of left panel) to create new database.
Choose name of database from pst and select a Collection as shown below −
You can add document directly or import from CSV or JSON file.
Choose Insert Document from Add data drop down.
Documents added will be displayed in JSON, pst or tabular form −
Note that, just as a table in relational database has a primary key, document in MongoDB database has a special key called "_id" that is automatically generated.
MongoDB Inc. provides a Python driver for connection with MongoDB databases. It is called PyMongo whose usage is similar to standard SQL queries.
After instalpng PyMongo module, we need object of MongoCpent class for interacting with MongoDB server.
<<< from pymongo import MongoCpent <<< cpent=MongoCpent()
New database is created with the following statement −
db=cpent.mydatabase
CRUD operations on this database are performed with methods such as insert_one() (or insert_many()), find(), update() and delete() methods. Detailed discussion of PyMongo pbrary is available at
.However, Python’s user defined objects cannot be stored in database unless it is converted in MongoDB’s data types. This is where we need MongoEngine pbrary.
Advertisements