Skip to content

Collection.filter()

David Fahlander edited this page Jun 10, 2016 · 3 revisions

Syntax

collection.filter(filter)

Parameters

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

Return Value

This Collection instance (this)

Remarks

This method is identical to Collection.and()

Sample

db.friends.orderBy('age').filter(function (friend) {
    return friend.name === "Foo";
});
Clone this wiki locally