Regular expression is used to store regular expressions Code is used to store

Regular expression is used to store regular

This preview shows page 3 - 5 out of 7 pages.

Regular expression is used to store regular expressions Code is used to store JavaScript code into the document Binary data is used to store binary data Object ID is used to store documents ID Data is used to store the current date or time in UNIX format Symbol is used for languages that uses a specific symbol Null is used to store a Null value Object is used to store a null value Timestamp is used for recording when a document has been modified or added Array is used to store arrays or list or multiple values into one key Min/Max keys is a typed used to compare a value against the lowest and Highest BSON elements Double used to store floating point values Boolean is used to store true / false values Integer is used to store numerical value can be 32 bit or 64 bit String is used to store the data, must be UTF-8 valid How does one insert a document in MongoDB? Provide an example by inserting at least 20 Documents. Make sure you run this on your machine and it runs before you pasted the answer here > use Test3 switched to db Test3 > db.createCollection("myCollection") { "ok" : 1 } > db.myCollection.insert({id: '1', title:'mobile data management', likes:1000}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '2', title:'database', likes:9800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '3', title:'database', likes:9800}) WriteResult({ "nInserted" : 1 })
Image of page 3
> db.myCollection.insert({id: '4', title:'database', likes:9800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '5', title:'database', likes:9800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert[{id: '6', title:'database', likes:9800}) > db.myCollection.insert({id: '6', title:'database', likes:9800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '7', title:'java', likes:800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '8', title:'java', likes:800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '9', title:'java', likes:800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '10', title:'java', likes:800}) WriteResult({ "nInserted" : 1 }) > db.myCollection.insert({id: '11', title:'mobile apps', likes:500})
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 7 pages?

  • Three '19
  • Sam
  • Type system, command use db.createCollection

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes