Skip to content

stashBefore - add support for bulk operations #757

@muhammadyusuf-kurbonov

Description

@muhammadyusuf-kurbonov

Steps to reproduce

  1. Create a Mongoose service with option multi: true.
  2. Add before patch hook: stashBefore
  3. Run service.patch(null, { query: { date: "2024-08-14" }, mongoose: { upsert: true } }

(First please check that this issue is not already solved as described
here
)

Expected behavior

At least, I don't want an error: Not found element with id null. At best, I want to stash these multiple item.

Actual behavior

My log is flooded with errors: Not found element with id null, because our app make some bulk writes to this table.

Module versions (especially the part that's not working):
Feathers v3 (yes it is old, but project is legacy and huge)
Feathers mongoose: 7.3.1 (tried also with 8)
Feathers-hooks-common: 4.20.2 (according source code, this error will happen in latest version)

NodeJS version:
NodeJS 16

Operating System:
Linux, Fedora 40

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions