Collection.filter()

Syntax

collection.filter(filter)

Parameters

filter: Functionfunction (value) { return true/false; }

Return Value

This Collection instance (this)

Remarks

This method is identical to Collection.and()

Sample

const collection = db.friends
  .orderBy('age')
  .filter((friend) => /foo/i.test(friend.name));
  
const result = await collection.offset(50).limit(25).toArray();

Table of Contents