Grokking MongoDB
Vote

0% completed

​

Specify JSON Schema Validation

Nothing in a new MongoDB collection stops the insert below, even though the price is not a number:

db.products.insertOne({ name: "Laptop", price: "cheap" })
{ acknowledged: true, insertedId: ObjectId('6ae7567ff4111722c4cb0ce5') }

The application finds the problem later, when it tries to add "cheap" to a total. A flexible schema is useful while a design is changing, but systems such as financial records, online shops and content management often need a guarantee about their data

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content