Skip to content

How to remove documents during incoming/outgoing handlers? #45

Description

@JamesMGreene

I'm looking to setup a PouchDB environment such that documents can contain an expiry property (e.g. an expiresAt timestamp).

As such, I am interested in if I can utilize this plugin's incoming/outgoing functionality to check a document's expiry when being read/written and verify it should still exist. If so, return it; if not, remove it from the database and do not return it.

Looking through the code and issue tracker, it is not at all clear how to achieve this.

The README does, however, mention this basic concept in passing:

This allows you to:

  • ...
  • Remove or modify documents before storage (e.g. to massage data from CouchDB)

Can someone please help me understand how to hook such a thing up?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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