Tag: Mongodb

22 articles

MongoDB Basic Operations: Database, Collection & CRUD Guide

MongoDB common commands include show dbs to list databases, use to switch databases, db.createCollection() to create collections, show collections to list collections, db.

NoSQL Databases: MongoDB, Redis, HBase, Neo4j Comparison

NoSQL is a general term for non-relational databases, including document-based MongoDB, key-value Redis, column-store HBase, and graph database Neo4j, each with its own c...

MongoDB BSON Format: Core Storage Format vs JSON

BSON is MongoDB's core storage format, a binary-encoded JSON-like format. Compared to JSON, BSON supports more data types like Date, Binary, ObjectId, with better perform...

MongoDB Indexing: Types, Principles & Best Practices

MongoDB indexes are core mechanisms for improving query performance, including single field indexes, compound indexes, multi-key indexes, geospatial indexes...

MongoDB Index Management & explain Execution Plan Analysis

MongoDB index management includes createIndex, getIndexes, dropIndex operations.

MongoDB Aggregation: $match, $group, $project and $sort Pipelines

MongoDB aggregation framework processes documents through multi-stage pipelines, implementing complex operations similar to SQL GROUP BY, JOIN, SUM, AVG.

MongoDB Pagination: skip() + limit() + sort() & Performance

MongoDB implements pagination through combination of skip(), limit() and sort() methods.

MongoDB Data Insert, Batch Write and Logical Queries with AND/OR

MongoDB data operations include single insertOne() and batch insertMany(). Query operators include $eq, $ne, $gt, $lt, etc. Logical operators include $and, $or, $not.

MongoDB vs MySQL: B-Tree vs B+Tree Index Mechanisms

MongoDB uses B-tree indexes where nodes store both data and keys. MySQL uses B+tree indexes with all data concentrated in leaf nodes.

MongoDB Use Cases & Selection Guide

MongoDB is suitable for website data storage, caching systems, big data analysis, IoT, social media, live streaming platforms and more.

Spring Boot MongoDB: Template vs Repository with Index Tips

Two ways to connect Spring Boot to MongoDB: MongoTemplate and MongoRepository, with complete Java code examples and common problem troubleshooting.

Java MongoDB CRUD: Complete Guide from Setup to Operations

Complete guide to accessing MongoDB with Java, including environment setup, Maven dependencies, connection, CRUD operations, POJO mapping, index management.

MongoDB Slow Query Analysis & Index Tuning

MongoDB slow query analysis through built-in Profiler, set db.setProfilingLevel(1, m) to record slow queries. EXPLAIN analysis helps identify performance bottlenecks and...

MongoDB Storage Engines: WiredTiger vs InMemory Comparison

Comparison of MongoDB's two main storage engines WiredTiger and InMemory, including configuration methods and verification steps. WiredTiger recommended for production en...

MongoDB Replica Set Containerization: Keyfile and Auth Quick Start

MongoDB 7 replica set containerization best practices: generate keyfile, explicitly enable --auth, use one-time container for rs.initiate and admin user creation.

MongoDB Replica Set Deployment: Single Machine, Three Instances

MongoDB replica set single machine three instance deployment guide including configuration, initialization, adding/removing nodes, elections, read-write separation and ro...

MongoDB Data Modeling: Embedded vs Reference Selection Guide

MongoDB data modeling choice between embedded and reference, following three principles: embed for 1:few, use reference for unbounded growth, use $lookup+index for cross-...

MongoDB Replica Set: oplog, Heartbeat & Elections Explained

MongoDB replica set concepts: oplog location and idempotency, heartbeat frequency and election timeout, member/voting limits (50/7). Note that master-slave replication wa...

MongoDB Production Security Hardening: Auth, RBAC & TLS

MongoDB production environment security hardening guide including authentication, RBAC minimum privileges, internal network bindIp/firewall ACL, TLS/SSL encryption.

MongoDB Sharding: Shard, Config Server and Mongos Complete Guide

MongoDB sharded cluster detailed explanation: sharding consists of Shard, Config Server, Mongos. Shard key selection includes range sharding, hashed sharding...

MongoDB Auth and Permissions: From Single Instance to Sharded Cluster

MongoDB authentication and permission configuration from single instance to sharded cluster. Implementation order: create admin/root first → enable authorization → assign...

MongoDB Sharded Cluster Deployment: Complete Guide with Scripts

Step-by-step MongoDB sharded cluster setup (configsvr×3 + two shard replica sets×3 nodes + multiple mongos), including configuration, initialization, adding shards...