Skip to content

Instantly share code, notes, and snippets.

@sz3n
Last active July 2, 2016 21:30
Show Gist options
  • Save sz3n/29d5cc53f4ce914678c862afcc950b84 to your computer and use it in GitHub Desktop.
Save sz3n/29d5cc53f4ce914678c862afcc950b84 to your computer and use it in GitHub Desktop.
mongodb
# Start the new service and enable it on boot
systemctl --system daemon-reload
systemctl start mongod.service
systemctl enable mongod.service
mongorestore -d pstm -c pastes --dir=/data/dumpmon/dump/pstm/pastes.bson --host=127.0.0.1
mongodump
db.pastes.find({}).sort({_id:-1}).limit(10)
db.pastes.count()
show dbs
show collections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment