Coder Social home page Coder Social logo

passioninfinite / mongoosejs-soft-delete Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 4.0 64 KB

Soft Delete plugin for mongoose.

License: MIT License

JavaScript 100.00%
mongoosejs soft delete plugin mongoose mongoose-plugin mongodb mongoosejs-soft-delete soft-deletes schema

mongoosejs-soft-delete's People

Contributors

dependabot[bot] avatar parth7676 avatar passioninfinite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mongoosejs-soft-delete's Issues

`findByIdDeleted` not working as described

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
...
}

Add deletedBy

Is your feature request related to a problem? Please describe.
Your plugin it's awesome. I think the only is missing is to track the user with deletedBy

Describe the solution you'd like
Have a deletedBy property and set value on delete.

Need work on .count

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Currently don't work on count

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.
Need work on count method

Improve Readme by adding js tag

Is your feature request related to a problem? Please describe.
We can improve the readme reading by adding js format

Describe the solution you'd like
Add js tag after triple back quotes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.