[MongoDB]: Writing Complex queries Using QueryBuilder
Writing Complex MongoDB Queries Using QueryBuilder MongoDB provides a lot of query selectors for filtering documents from a collection. Writing complex queries for MongoDB in Java can be tricky sometimes. Consider below data present in student_marks collection rs1:PRIMARY> db.dbversit.insert({“_id” :…
[MongoDB]: Linux ulimit Settings
How do we review and set resource limits : Here’s the command to see unlits is below [root@dbversitydotcom oracle]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks,…
[MongoDB]: CSharp/.NET to test Auth
METHOD 1 : using System; using MongoDB.Bson; using MongoDB.Driver; using MongoDB.Driver.Builders; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var connectionString = “mongodb://admin:pwd@dbversitydotcom/admin”; MongoClient client = new MongoClient(connectionString); MongoServer server…
[MongoDB]: Nested documents
Please refer my previous post for the background of the issues with nested documents at Issues-with-Nested-documents However, versions prior to 2.8-rc1 doesn’t handle nested documents properly – neither mongoimport nor mongoexport. But the good news is that both work with nested…
[MongoDB]: Different ways in Purging
There are three ways to do purging in MongoDB. Single collection, delete old entries Collection per day, drop old collections Database per day, drop old databases Option #1: single collection pros ==== Easy to implement Easy to run Map/Reduces cons…
Hadoop and MongoDB
What is Hadoop? Hadoop is a software technology designed for storing and processing large volumes of data using a cluster of commodity servers and commodity storage. Hadoop is an open-source Apache project started in 2005 by engineers at Yahoo. It…
What is NoSQL ?
Understanding NoSQL NoSQL refers to a database that is not based on SQL (Structured Query Language), which is the language most commonly associated with relational databases. Essentially, NoSQL data isn’t relational, NoSQL databases usually do not have schema, and they…
[MongoDB]: How to get nested document thru mongoimport
Imagine you’ve a flat CSV something like below, but you wanted to create a nested document something like dbversity collection below with mongoimport – how do we do ? Files,FileName,Extension,Size,SubFolders \\dbversity\\dbversity_files,dbversity_file00.db,db,1024,Subfolder1 \\dbversity\\dbversity_files,dbversity_file11.db,db,500,Subfolder2 \\dbversity\\dbversity_file1,dbversity_file22.db,db,250,Subfolder1 [root@dbversity ~]# mongo –port 27010 MongoDB shell…
Node.JS Installation
Installing from binary (pre-built): Download the latest nodejs binary package (it will include npm as well) – http://nodejs.org/download/ curl -O http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-x64.tar.gz Decompress the package and rename the directory: tar xzf node-v0.10.24-linux-x64.tar.gz mv node-v0.10.24-linux-x64 node Update your PATH to reference the…
[MongoDB] : Basic Troubleshooting
db.runCommand( { replSetGetStatus: 1 } ) – returns all members in replica set + their status.(All members should be either PRIMARY or SECONDARY) db.printSlaveReplicationInfo() – returns sync differences between members of replica set, good values should be under a minute….