This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
random: 4583, | |
favorite_color: “blue”, | |
age: 29, | |
gender: “M”, | |
favorite_food: “pizza”, | |
city: “NYC”, | |
shoe_size: 11 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replset:SECONDARY> db.adminCommand( "shutdown" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E11000 duplicate key error index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ ! $# -eq 2 ]; then | |
echo "USAGE 2 parameters required: 'hostname' 'port'"; | |
exit -1; | |
fi | |
$ mongo myDatabase --host $1 --port $2 --eval "db.myCollection.ensureIndex( { a: 1 }, { unique: true })" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ ! $# -eq 2 ]; then | |
echo "USAGE 2 parameters required: 'hostname' 'port'"; | |
exit -1; | |
fi | |
$ mongo myDatabase --host $1 --port $2 --eval "db.myCollection.ensureIndex( { a: 1 }, { unique: true })" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mongo myDatabase --port 27018 --eval "db.myCollection.ensureIndex( { a: 1 }, { unique: true })" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replset:PRIMARY> rs.stepDown( 120 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replset:PRIMARY> rs.stepDown() | |
2015-06-16T16:01:25.298-0400 I NETWORK DBClientCursor::init call() failed | |
2015-06-16T16:01:25.303-0400 E QUERY Error: error doing query: failed | |
at DBQuery._exec (src/mongo/shell/query.js:83:36) | |
at DBQuery.hasNext (src/mongo/shell/query.js:240:10) | |
at DBCollection.findOne (src/mongo/shell/collection.js:187:19) | |
at DB.runCommand (src/mongo/shell/db.js:58:41) | |
at DB.adminCommand (src/mongo/shell/db.js:66:41) | |
at Function.rs.stepDown (src/mongo/shell/utils.js:1001:43) | |
at (shell):1:4 at src/mongo/shell/query.js:83 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo:PRIMARY> rs.printReplicationInfo() | |
configured oplog size: 192MB | |
log length start to end: 897secs (0.25hrs) | |
oplog first event time: Wed Jul 15 2015 13:21:10 GMT-0700 (PDT) | |
oplog last event time: Wed Jul 15 2015 13:36:07 GMT-0700 (PDT) | |
now: Wed Jul 15 2015 13:36:46 GMT-0700 (PDT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'org.mongodb.mongo-hadoop:mongo-hadoop-core:1.4.0' |