Hi Aaron,
Please find below code snippet for the same and let me know if you required any other help from our side:
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
GeoQuery query = QueryBuilder.BuildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
App42Log.SetDebug(true); //Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
StorageService storageService = App42API.BuildStorageService();
storageService.SetPageOffset(0); // Based on page index, change the value offset value
storageService.SetPageMaxRecords(10);
storageService.SetGeoTag(gp);
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);
}
}
Regards,
Himanshu Sharma