AWS DocumentDB

Credits Educative.io

AWS DocumentDB creates a MongoDB database cluster, and we’ll store some data in it. We can also create a snapshot and create a new cluster from it.

Some key points:

MongoDB shell has it’s own language, and we can run commands like show dbs, db.createCollection(“users”), db.users.insert({name: “John”}), db.users.find(), etc. For example, to insert a row into a mp3players collection, we can run the following command:

db.mp3playlist.insertMany([
   {
      id: 1,
      title: "Song 2",
      artist: "Blur",
      duration: "5:47",
      album: "Blur"
    }
])

db.mp3playlist.find({ "artist": "XYZ" })