hitesh kumar
unread,Apr 13, 2012, 7:24:05 AM4/13/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi all,
Currently I am using java to connect to MONGODB,
i want to write this sql query in mongodb using java driver
select * from tableA where name like("%ab%")
now is their any solution to perform the same task through java,
the query in mongodb is very simple i know, the query is
db.collection.find({name:\ab\})
but how to perform same task in java
Current I am using pattern matching to perform the task and code is
DBObject A = QueryBuilder.start("name").is(Pattern.compile("ab",
Pattern.CASE_INSENSITIVE)).get();
but it makes query very slow I think , so I need a solution other than
this pattern matching,
So, it their is any solution available, Please contribute,,
thanks in advance