4 thoughts on “Hands-on MongoDB :: Part-1”

  1. Getting this error. I need to figure out a way to drop the nodes and recreate
    show dbs
    uncaught exception: Error: listDatabases failed:{
    “topologyVersion” : {
    “processId” : ObjectId(“60248a0de9c2ab16e871704b”),
    “counter” : NumberLong(4)
    },
    “operationTime” : Timestamp(1613008824, 1),
    “ok” : 0,
    “errmsg” : “not master and slaveOk=false”,
    “code” : 13435,
    “codeName” : “NotPrimaryNoSecondaryOk”,
    “$clusterTime” : {
    “clusterTime” : Timestamp(1613008824, 1),
    “signature” : {
    “hash” : BinData(0,”AAAAAAAAAAAAAAAAAAAAAAAAAAA=”),
    “keyId” : NumberLong(0)
    }
    }
    } :
    _getErrorWithCode@src/mongo/shell/utils.js:25:13
    Mongo.prototype.getDBs/<@src/mongo/shell/mongo.js:147:19
    Mongo.prototype.getDBs@src/mongo/shell/mongo.js:99:12
    shellHelper.show@src/mongo/shell/utils.js:937:13
    shellHelper@src/mongo/shell/utils.js:819:15
    @(shellhelp2):1:1

    1. The reason for this is because you are performing operations from the secondary. This was to be covered later. Will add a “alert” so folks know not to fall into this trap.

  2. mongodb-rs:PRIMARY> db.contacts.update({ first: “Charlie” }, { mobile: { personal: “678 901 2345” } )

    parenthesis mismatch on the above

Comments are closed.