Company
Date Published
Author
Christian Kvalheim
Word count
1224
Language
English
Hacker News points
4

Summary

The Node.js MongoDB 2.0 Driver introduces significant changes to improve developer experience, including a new CRUD API specification, architectural differences between mongodb-core and mongodb, and removal of deprecated features such as Grid Objects and db instance object methods. The driver has been split into two pieces, with mongodb-core containing the low-level MongoDB APIs and mongodb providing the high-level driver. The 2.0 driver implements the new Server Discovery and Monitoring specification and introduces new CRUD names for cross-platform API development. It also addresses long-standing requests, including exposing entire write results in insert/update and delete methods. The update returns value has been modified to include more information, such as upserted documents. New methods have been added for inserting, updating, replacing, and deleting documents, with the current insert, update, and remove methods marked for deprecation. The driver also introduces changes to how collection.find works, requiring chaining commands instead of passing them into the find method. Additionally, the GridStore object has undergone significant changes due to issues discovered by users related to parallel writing using the previous available w+ append mode, limiting it to only allowing changes to file metadata.