Skip to content

Instantly share code, notes, and snippets.

@phillipadsmith
Created March 5, 2013 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phillipadsmith/ca5758a142a0f19dd471 to your computer and use it in GitHub Desktop.
Save phillipadsmith/ca5758a142a0f19dd471 to your computer and use it in GitHub Desktop.
# This query in Mongo works:
db.tweets.find({ 'extracted': { $exists: false } }).count()
# This query in Mango does not return the same results (filter not applied)
my $results = $mango->db( 'fomo' )->collection( 'tweets' )
->find(
{
'extracted' => { '$exists' => 'false' },
}
)->all;
# This query in Mango returns the same (correct) results as the Mongo query
my $results = $mango->db( 'fomo' )->collection( 'tweets' )
->find(
{
'extracted' => { '$nin' => ['1'] },
}
)->all;
@MadMartigan
Copy link

my $results = $mango->db( 'fomo' )->collection( 'tweets' )
->find(
{
'$exists' => { 'extracted' => 'false' },
}
)->all;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment