• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problem with Filters class

 
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,
I need the count of filtered records in a collection. I am using count method with filter criteria. For filter criteria, I am using" Filters.eq(key, value) method but I am not getting the zero result though it has the document with that filter criteria.
If any one has used Filter class then please let me know what wrong I am doing.

Regards,
Vikas
 
Marshal
Posts: 5215
323
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps a code example might help here showing your usage of the Filter / Filters class? Your question is a little vague just now.
 
VikasKumar Gupta
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Tim,
Please find the code snippet.

               
 
VikasKumar Gupta
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am able to solve this issue and the problem is, Mongodb is case sensitive and key name i suppose to pass should be in upper case but i was passing it in lower case.
Silly mistake but it wasted my lot of time. Lesson learned.

Thanks,
Vikas
 
reply
    Bookmark Topic Watch Topic
  • New Topic