Skip to content

A small monkeypatch for backbone collections to make it work with backbone-deep-model

License

Notifications You must be signed in to change notification settings

therebelrobot/backbone-deep-model-collection-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backbone-deep-model-collection-search

A small sideloader for backbone collections to make it work with backbone-deep-model

Installation

npm install --save backbone-deep-model-collection-search

Usage

var BackboneCollection = require('backbone-deep-model-collection-search')(Backbone.Collection)

// Build your own collection from this

var List = BackboneCollection.extend({ ... })

var thisNewList = new List()

thisNewList.deepSearch({'dot.delimited.search.term':true})

// returns array of results, so for no matches [], for 2 matches [model, model]

Why

This stemmed out of my need to deep search collections that contain deep-linked models, as described in this issue.

License

ISC

About

A small monkeypatch for backbone collections to make it work with backbone-deep-model

Resources

License

Stars

Watchers

Forks

Packages

No packages published