Closed guoyoujin closed 9 years ago
Thanks! Could you please provide some more details on this problem?
Where is this code from? Is it from the library or from your custom code?
If there's an exception, can you post the stack trace?
From meteor. Java file
I want to query databse user _id = 10 user query data? How to implement? can you help me?
Finding an entry from users
where _id = 10
would be something like this in MongoDB:
db.users.find({ _id: 10 })
With this library, the equivalent would be similar to the following:
Map<String, Object> query = new HashMap<String, Object>();
query.put("_id", 10);
mMeteor.call("/users/find", query);
Thank you, I have solve this problem
@guoyoujin could you tell me how you solve your problem, the slash at the beginning is only needed when accessing collections, so how do you handle the method in server because it's started with slash and need a return data, and how do you handle the data,, can you give me some example code, please,
@isdzulqor Sorry, the example was probably wrong. As we found out in the other issues already, you can't call the find
method. You really have to use subscriptions and onDataAdded(...)
.
Nevertheless, it would be interesting to know how you solved your problem, @guoyoujin -- that's right :)
@mwaclawek yeah,, I have found my solution and it's solved
@isdzulqor Sorry, what is more, these days I was not pay attention to the mail, you can look at my code, though he is written using Chinese https://github.com/guoyoujin/learning-android-ddp
How are you, The result is not a valid json data, it for more than two " "
if (listener instanceof ResultListener) { mListeners.remove(id); final String result; if (data.has(Protocol.Field.RESULT)) { result = data.get(Protocol.Field.RESULT).toString(); } }