Finding JSON Data using geoquery gives error

0 votes

When using the code given in, it gives an error in mismatch type of arguments as findDocumentsbyQuery cannot be used with geoquery. Please help.

asked Mar 4, 2016 in Android by 12bce071 (10 points)

1 Answer

0 votes



Please find below code snippet to fetch document based on geo query and let me know if it helps:

String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
GeoTag gp = new GeoTag();
GeoQuery query = QueryBuilder.BuildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
App42Log.SetDebug(true);		//Print output in your editor console
StorageService storageService = App42API.BuildStorageService(); 
storageService.FindDocumentsByLocation(dbName, collectionName, query, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
	public void OnSuccess(object response)
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
			App42Log.Console("objectId is " + jsonDocList[i].GetDocId());
			App42Log.Console("jsonDoc is " + jsonDocList[i].GetJsonDoc());

	public void OnException(Exception e)
		App42Log.Console("Exception : " + e);


Himanshu Sharma
answered Mar 4, 2016 by hs00105 (2,005 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on