It is possible that multiple documents in a single collection have the same attribute of different type. In the example below the test attribute has a value number 1 on the first document and a string value in the second.
> db.grades.insert( {"test" : 1, "test var" : 1 } ) > db.grades.insert( {"test" : 1, "test var" : "string one" } ) > > db.grades.find( { "test" : 1 }) { "_id" : ObjectId("52b77870e7a1580719615d4a"), "test" : 1, "test var" : 1 } { "_id" : ObjectId("52b77877e7a1580719615d4b"), "test" : 1, "test var" : "string one" }
No comments:
Post a Comment