0

I have this query string :

coll.find(and(DBQuery.greaterThanEquals("createdOn", startDate), DBQuery.lessThanEquals("createdOn", endDate),DBQuery.is("user_email",userEmail)));

I am getting the error :

cannot find symbol [symbol: variable DBQuery] [location: class models.food.UserMeal]

Now a plain DB query

coll.find(); is working smoothly. What package am I missing for this to work?

Update :

I tried importing : import org.mongojack.DBQuery; but instead got the error : package org.mongojack does not exist

Rohit Rane
  • 2,790
  • 6
  • 25
  • 41

2 Answers2

2

Mongojack is the dependency

<dependency>
   <groupId>org.mongojack</groupId>
   <artifactId>mongojack</artifactId>
   <version>2.3.0</version>
</dependency>
José Ricardo Pla
  • 1,043
  • 10
  • 16
  • I resolved the dependency according to the official documentation but now I am getting "cannot find symbol [error] symbol : method find(org.mongojack.DBQuery.Query)" – Rohit Rane May 07 '15 at 07:54
1

Accoding to official documentation you should import exactly org.mongojack.DBQuery.

So your problem is with library dependencies. Obviously you have missed mongojack library, e.g.

<dependency>
    <groupId>org.mongojack</groupId>
    <artifactId>mongojack</artifactId>
    <version>2.3.0</version>
</dependency>
Andremoniy
  • 34,031
  • 20
  • 135
  • 241
  • I resolved the dependency according to the official documentation but now I am getting "cannot find symbol [error] symbol : method find(org.mongojack.DBQuery.Query)" – Rohit Rane May 07 '15 at 07:54
  • @jackOfAll this is another question. We have helped you solve the problem which was mentioned in the post – Andremoniy May 07 '15 at 08:08