Skip to content

[enhancement] use findOneAndUpdate, findOneAndDelete to speed up patch, update and remove #104

@beeplin

Description

@beeplin

Currently patch, update and remove requires one find and one update/remove towards the DB. Actually for single-document-write(id !== null), we can use findOneAndUpdate, findOneAndDelete from the native mongodb api (https://mongodb.github.io/node-mongodb-native/3.0/tutorials/crud/#findoneandupdate-findoneanddelete-and-findoneandreplace) to do the modification and query with only one DB operation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions