[MongoDB]: Working with shards
ReplicaSet 1 (rs1) : =================== ./mongod –shardsvr –replSet rs1 –dbpath /data/rs1_1 –logpath /data/rs1_1/rs1_1_mongod.log –port 27010 –smallfiles –nojournal –quiet & ./mongod –shardsvr –replSet rs1 –dbpath /data/rs1_2 –logpath /data/rs1_2/rs1_2_mongod.log –port 27011 –smallfiles –nojournal –quiet & ./mongod…
[MongoDB]: How can I create a user with hash password insert with __system role.
__system¶ MongoDB assigns this role to user objects that represent cluster members, such as replica set members and mongos instances. The role entitles its holder to take any action against any object in the database. Do not assign this role…
[MongoDB]: How to configure & reconfigure a RS
[root@ip-10-0-0-28 /]# ps -ef | grep mongo root 7135 2216 0 01:26 pts/0 00:00:00 mongod –replSet rs2 –dbpath /root/data4 –logpath /root/data4/mongod1.log –port 27010 –smallfiles –nojournal root 7191 2216 0 01:26 pts/0 00:00:00 mongod –replSet rs2 –dbpath /root/data5 –logpath /root/data5/mongod2.log –port…
[MongoDB]: Aggregation with date
When we need to count the number of subdocuments based on certain criteria, including a date field. Looking for options on how best to handle the date field for this requirement. Sample document: { “_id” : “FCa123”, “txnUidSid” : “123”,…
[MongoDB]: How to truncate/chop off time-stamp from Date
How to truncate/chop off time-stamp from Date > db.dbversity.find({},{tradeDate:1}) { “_id” : “1”, “tradeDate” : ISODate(“2015-06-25T18:30:00Z”) } { “_id” : “2”, “tradeDate” : ISODate(“2015-06-25T18:30:00Z”) } { “_id” : “3”, “tradeDate” : ISODate(“2015-06-24T18:30:00Z”) } { “_id” : “4”, “tradeDate” : ISODate(“2015-06-23T18:30:00Z”)…
MongoDB WiredTiger
A Technical Introduction to WiredTiger Document-level Concurrency In-memory performance Multi-core scalability Checksums Compression Durability with & without journaling MongoDB 3.0 introduces a new pluggable storage engine API and a new storage engine called WiredTiger. The engineering team behind WiredTiger…
[MongoDB]: Aggregation with $unwind for querying subdocuments in an Array
[ root @ dbvesitydotcom : ~ ] mongo MongoDB shell version: 2.6.5 connecting to: test > > > use dbversity_db switched to db dbversity_db > > db.mycol.insert({L1F1:”val1″,L1F2:[{L2F1:”val2″,L2F2:”val3″,L2F3:[{L3F1:”val50″, L3F2:”val51″,L3F3:”val52″},{L3F1:”val53″, L3F2:”val54″,L3F3:”val55″}]},{L2F4:”val4″,L2F5:”val5″}]}) WriteResult({ “nInserted” : 1 }) > > > db.mycol.find().pretty() { …
MongoDB ahead of Cassandra and Couchbase for scalability – report
MongoDB has raced ahead of its NoSQL database competitors Cassandra and Couchbase for scalability, according to tests using the Yahoo Cloud Serving Benchmark (YCSB). The research, carried out by benchmarking and performance-testing firm United Software Associates (USA Inc), involved evaluating…
[MongoDB]: Overview
• A Document database • Developed by MongoDB Inc. • Latest version is 3.0.2 (released on April 9, 2015) • Runs on most platforms such as Red Hat Enterprise, CentOS, Fedora Linux, Ubuntu, Debian, Linux, OS X, Windows • Supports…