Closed musafirkhana closed 8 years ago
Hi, you can see this issue #94 that I did some days ago. I have not closed that because I have not proved the last answer from @mwaclawek, but I think that you can do it with your example.
Yes, thanks for helping @cristianhoyos66!
@musafirkhana Please follow the code example from the linked issue and report your findings here. What you did so far is correct. The solution is to know that the field that you retrieved in the end corresponds to the data type that you saved there in JavaScript, i.e. on the Meteor server.
String
in Java.Integer
, Long
, Float
or Double
in Java.Boolean
in Java.{}
) in JavaScript, the field is of type Map<String, Object>
in Java. This should be what you have here.[]
) in JavaScript, the field is of type List<Object>
or Object[]
in Java. I'm not sure, you have to try this.Hope that helps!
I have a json like this.
{ "role" : { "id" : 3, "name" : "Customer" } }
How to i get the value "name" from document. I am usingdatabase.getCollection(collectionName).getDocument(documentId).getField("role");
for getting role its return me role={id=3,name=Customer}How can i manage that ? Thanks