MongoDB
Repair Mongo after bad termination
Remove mongod.lock
mongod --dbpath ~/data/db/ --repair
http://www.mongodb.org/display/DOCS/Durability+and+Repair
Mongo dump and restore
mongodump --db lux
tar -xvf dump-20120401.tar.gz
mongorestore dump
Drop database
use foo; db.dropDatabase();
Drop collection
http://www.mongodb.org/display/DOCS/Overview+-+The+MongoDB+Interactive+Shell
db.foo.drop()
drop the entire foo collection
GUIs for examining
http://www.mongodb.org/display/DOCS/Admin+UIs
Retrieve a subset of fields
http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields
OpenID, Django, Mongo
https://github.com/arielbackenroth/openid-mongodb - storage for openid transactions
/data/db ownership settings
Change ownership of /data/db and all files inside: http://stackoverflow.com/questions/7948789/mongodb-mongod-complains-that-there-is-no-data-db-folder
Storing files with MongoDB
http://stevechallis.com/2010/oct/18/so-gridfs-mongoengine--django-walk-into-a-bar-/
Mongoengine
Selecting by a field in EmbeddedDocument
receipt = Receipt.objects(__raw__={'transaction.id': int(id)})
if receipt:
receipt = receipt[0]
Last edited by dudarev, 2012-05-17 08:27:59. Edit