Skip to content

findByIdDeleted not working as described #11

@DashBarkHuss

Description

@DashBarkHuss

The findByIdDeleted method isn't working as described in the docs.

In the docs it says that findByIdDeleted takes a callback that returns a document

Sample.findByIdDeleted(sampleId, function(err, doc) {
    //doc.deletedAt will be current timestamp
    //doc.deleted will be true
})

But instead findByIdDeleted isn't doing anything with the callback.

const result = UserModel.findByIdDeleted('60b6dbd320329b2952db39e8', function (err, doc) {
        console.log(err || doc); // code never gets here
 });
 
 result //> returns a query

Also the function returns a model.Query, not a mongoose document:

model.Query {
_collection:NodeCollection {collection: NativeCollection, collectionName: 'users'}
_conditions:{_id: '60b6dbd320329b2952db39e8', deleted: true}
_distinct:undefined
_executionCount:0
_fields:undefined
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions