typicaljoe / taffydb

TaffyDB - an open source JavaScript Database for your browser
http://taffydb.com
MIT License
2.21k stars 285 forks source link

REGEX selection record count #142

Open kmaworld586 opened 7 years ago

kmaworld586 commented 7 years ago
let testRecords = [
        {
            ID: 2,
            Test: 'Test_1',
            Status: 'In Progress'
        }
        ,
        {
            ID: 13,
            Test: 'Test_3',
            Status: 'Queued'
        }
        ,
        {
            ID: 4,
            Test: 'Test_2',
            Status: 'Finished'
        }
    ]

    let Db = TAFFY([])

    Db.merge(testRecords)

    Db({
        Status: { 'regex': /Queued|Finished/ig }
    })