Unable to Get TaffyDB Working

203 views Asked by At

Trying to use TaffyDB in an AngularJS project, but i'm unable to get Taffy working.

Every time i try to get data from the TaffyDB, it's empty:

Object {extend: undefined, insert: undefined}

I'm just tying to do a simple test from their website:

<script src="vendors/taffydb-master/taffy.js"></script>

<script>
    $(document).ready(function () {
        //TaffyDB
        var friends = TAFFY([
            {"id":1,"gender":"M","first":"John","last":"Smith","city":"Seattle, WA","status":"Active"},
            {"id":2,"gender":"F","first":"Kelly","last":"Ruth","city":"Dallas, TX","status":"Active"},
            {"id":3,"gender":"M","first":"Jeff","last":"Stevenson","city":"Washington, D.C.","status":"Active"},
            {"id":4,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"}   
        ]);

        console.log(friends());   
    });
</script>

What am i doing wrong?

1

There are 1 answers

1
Shaun Webb On BEST ANSWER

Change

console.log(friends());

instead do

console.log(friends().get());