Thursday, April 16, 2015

General help

**Runing mongod server with manual configuration**

mongod --config /etc/mongodb.conf

example: mongodb.conf

#database location
dbpath=/home/nitin/MongoDB/databases
#where to log
logpath=/var/log/mongodb/mongod.log

logappend=true

#port = 27017

# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 127.0.0.1

References:

     [1] http://docs.mongodb.org/manual/administration/configuration/

**Morphia user guide**

References:

     [1] https://github.com/mongodb/morphia/wiki 


 

Thursday, January 8, 2015

Indexes in MongoDB

Indexing all fields for textual search:
db.collection.ensureIndex(
                           { "$**": "text" },
                           { name: "TextIndex" }
                         )


Drop all indexes
db.collection.dropIndexes()