mongodb - How to search a collection for every instance of a single keyword -


i'm trying figure out how search collection every instance of keyword. example, i'd search collection every instance of word "authenticated". below 1 of documents looks in collection contains keyword:

{     "_id": {         "$oid": "55945938d28f9f3809002afc"     },     "tags": ".source.s_net",     "sourceip": "10.10.0.5",     "seqnum": "11004",     "program": "core",     "priority": "info",     "message": "<pppoe-jjcutter>: authenticated",     "legacy_msghdr": "core ",     "host_from": "10.10.0.5",     "host": "10.10.0.5",     "facility": "syslog",     "date": "jul  1 14:18:48" } 

check github https://github.com/parthaindia/custommongo,

getbycondition(string tablename, map condition) ,call method tablename collection name ,map key-value.in case map be

map condition =new hashmap();

condition.put("message",": authenticated");//or whatever object

you receive array list in json format.use type token convert array list.


Comments

Popular posts from this blog

What Are The Best Universities In The World?

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World