Skip to content

Instantly share code, notes, and snippets.

@gabrielmiller
Created January 2, 2014 20:04
Show Gist options
  • Select an option

  • Save gabrielmiller/8225733 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielmiller/8225733 to your computer and use it in GitHub Desktop.

Revisions

  1. L. Gabriel Miller created this gist Jan 2, 2014.
    50 changes: 50 additions & 0 deletions balls.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    // "$and" and "$in"
    { "$and" : [
    { "projob.job.department" :
    { "$in" :
    [ "Engineering", "Marketing" ]
    }
    },
    { "projob.rating" : {
    "$in" :
    [ 3, 4, 5 ]
    }
    } ]
    }


    // "$and" and no "$in"
    { "$and" : [
    {
    "projob.department" : "Engineering"
    },
    {
    "projob.rating" : 5
    }]
    }


    // no "$and" and "$in"
    [
    { "projob.job.department" :
    { "$in" :
    [ "Engineering", "Marketing" ]
    }
    },
    { "projob.rating" : {
    "$in" :
    [ 3, 4, 5 ]
    }
    }
    ]


    // no "$and" and no "$in"
    [
    {
    "projob.job.department" : "Engineering"
    },
    {
    "projob.rating" : 5
    }
    ]