This is really hard. I want to find the select nodes.index where radio.mac_address="00:06:5A:03:2E:5B"
. how can I get this query in MongoDB using java?
My mongodb is as following.
I tried so many queries. one of them is as following
BasicDBObject query = new BasicDBObject("nodes.radios.mac_address", "mac_address value";
BasicDBObject fields = new BasicDBObject("nodes.$", 1);
DBCursor cursor = node_info.find(query, fields);
Updated First on got solved
How can i also write update query like update rssiLocal="90" where mac_address="00:06:5A:03:2E:5B"
.
In my application I use following method. It finds an object according to given
id
parses it viaGson
and saves it to corresponding object.