Fork me on GitHub




Batched Queries

Metadata Queries Edit on GitHub

All documents stored by Marten have Metadata attributes. These could of course be queried using PostgreSQL but there are some Linq methods predefined.

You could also define your own, see Extending Marten's Linq Support

Last Modified

Queries utilising mt_last_modified

  • ModifiedSince(DateTimeOffset) - Return only documents modified since specific date (not inclusive)
  • ModifiedBefore(DateTimeOffset) - Return only documents modified before specific date (not inclusive)


See Soft Deletes for further details

Queries utilising mt_deleted

  • IsDeleted() - Return only deleted documents
  • MaybeDeleted() - Return all documents whether deleted or not

Queries utilising mt_deleted_at

  • DeletedSince(DateTimeOffset) - Return only documents deleted since specific date (not inclusive)
  • DeletedBefore(DateTimeOffset) - Return only documents deleted before specific date (not inclusive)


See Metadata Indexes for information on how to enable predefined indexing