NoSQL Storage Service

Storage service provides an efficient way to manage JSON documents in NoSQL database on the cloud. You can store, update, search a JSON document and can also apply map-reduce search for storing documents. For example if you try to store a JSON document “{"Company":"Shephertz"}”, it will be stored with unique Object Id in the format: {“Company”:”Shephertz”,”_id”:{“$oid”:”4f423dcce1603b3f0bd560cf”}}. This oid can be used later to access/search the document.

Import Statement

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
import com.shephertz.app42.paas.sdk.android.App42API;
import com.shephertz.app42.paas.sdk.android.App42Response;
import com.shephertz.app42.paas.sdk.android.App42Exception;
import com.shephertz.app42.paas.sdk.android.App42BadParameterException;
import com.shephertz.app42.paas.sdk.android.App42NotFoundException;
import com.shephertz.app42.paas.sdk.android.storage.OrderByType;
import com.shephertz.app42.paas.sdk.android.storage.Query;
import com.shephertz.app42.paas.sdk.android.storage.QueryBuilder;
import com.shephertz.app42.paas.sdk.android.storage.Storage;
import com.shephertz.app42.paas.sdk.android.storage.StorageService;
import com.shephertz.app42.paas.sdk.android.storage.QueryBuilder.Operator;
using com.shephertz.app42.paas.sdk.windows;  
using com.shephertz.app42.paas.sdk.windows.storage;   
#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"   
import com.shephertz.app42.paas.sdk.jme.App42API;
import com.shephertz.app42.paas.sdk.jme.App42Response;
import com.shephertz.app42.paas.sdk.jme.App42Exception;
import com.shephertz.app42.paas.sdk.jme.App42BadParameterException;
import com.shephertz.app42.paas.sdk.jme.App42NotFoundException;
import com.shephertz.app42.paas.sdk.jme.storage.OrderByType;
import com.shephertz.app42.paas.sdk.jme.storage.Query;
import com.shephertz.app42.paas.sdk.jme.storage.QueryBuilder;
import com.shephertz.app42.paas.sdk.jme.storage.Storage;
import com.shephertz.app42.paas.sdk.jme.storage.StorageService;
import com.shephertz.app42.paas.sdk.jme.storage.QueryBuilder.Operator;
import com.shephertz.app42.paas.sdk.java.App42API;
import com.shephertz.app42.paas.sdk.java.App42Response;
import com.shephertz.app42.paas.sdk.java.App42Exception;
import com.shephertz.app42.paas.sdk.java.App42BadParameterException;
import com.shephertz.app42.paas.sdk.java.App42NotFoundException;
import com.shephertz.app42.paas.sdk.java.storage.OrderByType;
import com.shephertz.app42.paas.sdk.java.storage.Query;
import com.shephertz.app42.paas.sdk.java.storage.QueryBuilder;
import com.shephertz.app42.paas.sdk.java.storage.Storage;
import com.shephertz.app42.paas.sdk.java.storage.StorageService;
import com.shephertz.app42.paas.sdk.java.storage.QueryBuilder.Operator;
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.storage;
<script type="text/javascript" src="App42-all-x.x.x.min.js">&lt;/script>
require("App42-Lua-API.Operator")
require("App42-Lua-API.Permission")
require("App42-Lua-API.GeoOperator")
require("App42-Lua-API.OrderByType")
require("App42-Lua-API.Operator")
local JSON = require("App42-Lua-API.JSON") 
local queryBuilder = require("App42-Lua-API.QueryBuilder")
local App42API = require("App42-Lua-API.App42API")
local ACL = require("App42-Lua-API.ACL")
#include "App42API.h"
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.storage;  
 
include_once '../App42Response.php';  
include_once '../App42Exception.php';  
include_once '../App42BadParameterException.php';  
include_once '../App42NotFoundException.php';  
include_once '../OrderByType.php';  
include_once '../Query.php';  
include_once '../QueryBuilder.php';  
include_once '../StorageService.php';  
#include "App42API.h"
Coming Soon
import com.shephertz.app42.paas.sdk.as3.App42API;
import com.shephertz.app42.paas.sdk.as3.App42Response;
import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;
import com.shephertz.app42.paas.sdk.as3.storage.Storage;
import com.shephertz.app42.paas.sdk.as3.storage.StorageService;
import com.shephertz.app42.paas.sdk.as3.storage.JSONDocument;
import com.shephertz.app42.paas.sdk.as3.storage.GeoOperator;
import com.shephertz.app42.paas.sdk.as3.storage.GeoQuery;
import com.shephertz.app42.paas.sdk.as3.storage.GeoTag;
import com.shephertz.app42.paas.sdk.as3.storage.Operator;
import com.shephertz.app42.paas.sdk.as3.storage.OrderByType;
import com.shephertz.app42.paas.sdk.as3.storage.Query;
import com.shephertz.app42.paas.sdk.as3.storage.QueryBuilder;
import com.shephertz.app42.paas.sdk.as3.util.Util;
Coming Soon

Initialize

In order to use various the functions available in a specific API, a developer has to initialize with App42API by passing the apiKey and secretKey which will be created after the app creation from AppHQ dashboard.

Required Parameters

apiKey - The Application key given when the application was created. secretKey - The secret key corresponding to the application key given when the application was created.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
App42API.initialize("API_KEY","SECRET_KEY");
App42API.initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42.initialize("API_KEY","SECRET_KEY");
App42API:initialize("API_KEY","SECRET_KEY")
App42API::Initialize("API_KEY", "SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42API::initialize("API_KEY","SECRET_KEY");  
App42API::Initialize("API_KEY", "SECRET_KEY");
Coming Soon
App42API.initialize("API_KEY","SECRET_KEY");
Coming Soon

Build Service

After initialization, developer needs to call the buildXXXService method on App42API to get the instance of the particular API that you wish to build. For example, To build an instance of StorageService, buildStorageService() method needs to be called.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
StorageService storageService = App42API.buildStorageService(); 
StorageService storageService = App42API.BuildStorageService();  
StorageService *storageService = [App42API buildStorageService]; 
StorageService storageService = App42API.buildStorageService(); 
StorageService storageService = App42API.buildStorageService(); 
StorageService storageService = App42API.BuildStorageService(); 
var storageService  = new App42Storage();
local storageService = App42API:buildStorageService()
StorageService *storageService = App42API::BuildStorageService();
StorageService storageService = App42API.BuildStorageService(); 
$storageService = App42API::buildStorageService(); 
StorageService *storageService = App42API::BuildStorageService();
Coming Soon 
var storageService:StorageService = App42API.buildStorageService(); 
Coming Soon

Insert Json Document

Save the JSON document in giving database name and collection name.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc has to be saved. json - Target JSON document to be saved.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.insertJSONDocument(dbName, collectionName, json,new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();          
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	}  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.InsertJSONDocument(dbName,collectionName,json, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *json = @"{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage *storage = [storageService insertJSONDocument:dbName  collectionName:collectionName json:json]; 
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" ,  storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("Collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();          
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.InsertJSONDocument(dbName, collectionName, json, 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());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
var response ;  
storageService.insertJSONDocument(dbName, collectionName, json,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
		console.log("objectId is " + response.jsonDoc._id.$oid)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}"
local App42CallBack = {}
storageService:insertJSONDocument(dbName, collectionName, json,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("collectionName is "..object:getCollectionName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("Created At is "..object:getJsonDocList():getCreatedAt())
	print("Updated At is "..object:getJsonDocList():getUpdatedAt())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
string json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService->InsertJsonDocument(dbName, collectionName, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage storage = storageService.InsertJSONDocument(dbName,collectionName,json);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collectionName is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
$storage = $storageService->insertJSONDocument($dbName, $collectionName, $json); 
print_r("dbName is " . $storage->getDbName());
print_r("collectionName is " . $storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
string json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService->InsertJsonDocument(dbName, collectionName, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var json:String = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.insertJSONDocument(dbName,collectionName,json, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Insert Json Using Object

Save the JSON document in giving database name and collection name.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc has to be saved. json - Target JSON document to be saved.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONObject json = new JSONObject();
json.put("name","Nick");
json.put("age",30);
storageService.insertJSONDocument(dbName, collectionName, json, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JObject json = new JObject();
json.Add("name","Nick");
json.Add("age",30);
storageService.InsertJSONDocument(dbName,collectionName,json, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}    
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *json = @"{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage *storage = [storageService insertJSONDocument:dbName  collectionName:collectionName json:json]; 
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" ,  storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONObject json = new JSONObject();
json.put("name","Nick");
json.put("age",30);
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("Collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONObject json = new JSONObject();
json.put("name","Nick");
json.put("age",30);
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
} 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONClass json = new JSONClass();
json.Add("name","Nick");
json.Add("age",30);
App42Log.SetDebug(true);		//Print output in your editor console
storageService.InsertJSONDocument(dbName, collectionName, json, 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());
		}  
	}	
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>";
var json = new Object();
json.name = "Nick";
json.type = "30";
var response ;  
storageService.insertJSONDocument(dbName, collectionName, json,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
		console.log("objectId is " + response.jsonDoc._id.$oid)
		console.log("Created At is "+response.jsonDoc._$createdAt)
		console.log("Updated At is "+response.jsonDoc._$updatedAt)
	},  
	error: function(error) {  
	}  
});
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local json = {}
json.name = "Nick"
json.age = 30
local App42CallBack = {}
storageService:insertJSONDocument(dbName, collectionName, json,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("collectionName is "..object:getCollectionName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("Created At is "..object:getJsonDocList():getCreatedAt())
	print("Updated At is "..object:getJsonDocList():getUpdatedAt())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
App42Object *object = new App42Object();
object->setObject("name", "Nick");
object->setObject("age", 30);
storageService->InsertJsonDocument(dbName, collectionName, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONClass json = new JSONClass();
json.Add("name","Nick");
json.Add("age","30");
Storage storage = storageService.InsertJSONDocument(dbName,collectionName,json);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collectionName is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$json = new JSONObject();
$json.put("name","Nick");
$json.put("age",30);
$storage = $storageService->insertJSONDocument($dbName, $collectionName, $json); 
print_r("dbName is " . $storage->getDbName());
print_r("collectionName is " . $storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
App42Object *object = new App42Object();
object->setObject("name", "Nick");
object->setObject("age", 30);
storageService->InsertJsonDocument(dbName, collectionName, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var json:Object  = new Object();
json.name = "Nick"; 
json.age = 30; 
storageService.insertJSONDocument(dbName,collectionName,json, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Find All Collections

Find all collections stored in given database.

Required Parameters

dbName - Unique handler for storage name.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
storageService.findAllCollections(dbName, new App42CallBack() {
public void onSuccess(Object response)
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("Collection Name is " + storage.getCollectionName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});
String dbName = "<Your_DataBase_Name>";
storageService.FindAllCollections(dbName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;      
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collectionName is " + storage.GetCollectionName());
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>"; 
Storage *storage = [storageService findAllCollections:dbName]; 
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"Collection Name is %@" , storage.collectionName);
String dbName = "<Your_DataBase_Name>";
Storage storage = storageService.findAllCollections(dbName);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("Collection Name is " + storage.getCollectionName());
String dbName = "<Your_DataBase_Name>";
Storage storage = storageService.findAllCollections(dbName);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("Collection Name is " + storage.getCollectionName());
String dbName = "<Your_DataBase_Name>";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindAllCollections(dbName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response;      
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collectionName is " + storage.GetCollectionName());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
response ;  
storageService.findAllCollections(dbName,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is : " + response.dbName)
		console.log("collectionName is : " + response.collectionName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local App42CallBack = {}
storageService:findAllCollections(dbName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("collectionName is "..object:getCollectionName())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
storageService->FindAllCollections(dbName, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            printf("\n RecordCount=%lf\n",it->recordCount);
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
Storage storage = storageService.FindAllCollections(dbName);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collectionName is " + storage.GetCollectionName());  
$dbName = "<Your_DataBase_Name>";
$storage = $storageService->findAllCollections($dbName); 
print_r("dbName is " . $storage->getDbName());
print_r("collectionName is " . $storage->getCollectionName());
const char* dbName = "<Your_DataBase_Name>";
storageService->FindAllCollections(dbName, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            printf("\n RecordCount=%lf\n",it->recordCount);
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
storageService.findAllCollections(dbName,new callback()); 
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);  
		trace("dbName is " + storage.getDbName());   
		trace("collectionName is " + storage.getCollectionName());  
	}  
}  
Coming Soon 

Find All Documents

Find all documents stored in the given database and collection.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc has to be saved.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
storageService.findAllDocuments(dbName, collectionName, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
storageService.FindAllDocuments(dbName,collectionName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
Storage *storage = [storageService findAllDocuments:dbName collectionName:collectionName]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Storage storage = storageService.findAllDocuments(dbName,collectionName);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Storage storage = storageService.findAllDocuments(dbName,collectionName);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindAllDocuments(dbName,collectionName, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
response ;  
storageService.findAllDocuments(dbName,collectionName,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log(storageObj)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 

local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local App42CallBack = {}
storageService:findAllDocuments(dbName, collectionName, App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
storageService->FindAllDocuments(dbName, collectionName,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            printf("\n RecordCount=%lf\n",it->recordCount);
            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
            	printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Storage storage = storageService.FindAllDocuments(dbName,collectionName);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$storage = $storageService->findAllDocuments($dbName,$collectionName); 
print_r("dbName is :" . $storage->getDbName());
 print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
storageService->FindAllDocuments(dbName, collectionName,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            printf("\n RecordCount=%lf\n",it->recordCount);
            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
            	printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
storageService.findAllDocuments(dbName,collectionName, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{ 
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Find All Documents Count

Gets the count of all documents stored in the given database and collection.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
storageService.findAllDocumentsCount(dbName, collectionName, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("Total Records : " + app42response.getTotalRecords()) ;
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});
String dbName = "<Enter_the_dbName>"; 
String collectionName = "<Your_Collection_Name>";  
storageService.FindAllDocumentsCount(dbName,collectionName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
	 App42Response success = (App42Response) response;      
	 Console.WriteLine("Total Records : " + success.GetTotalRecords()) ;     
	 String jsonResponse = success.ToString();  
    }  
}  
NSString *dbName = @"<Enter_the_dbName>"; 
NSString *collectionName = @"<Your_Collection_Name>";  
App42Response *response = [storageService findAllDocumentsCount:dbName collectionName:collectionName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Response response = storageService.findAllDocumentsCount(dbName,collectionName);
System.out.println("Total Records : " + response.getTotalRecords()) ;  
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Response app42response = storageService.findAllDocumentsCount(dbName,collectionName);
System.out.println("Total Records : " + app42response.getTotalRecords()) ; 
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindAllDocumentsCount(dbName, collectionName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response success = (App42Response) response;    
		App42Log.Console("TotalRecords : " + success.GetTotalRecords());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
response ;  
storageService.findAllDocumentsCount(dbName,collectionName,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response;
		console.log("totalRecords is " + response.totalRecords)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local App42CallBack = {}
storageService:findAllDocumentsCount(dbName, collectionName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("Total Record is : "..object:getTotalRecords())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
storageService->FindAllDocumentsCount(dbName, collectionName,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",storageResponse->getTotalRecords());
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Response response = storageService.FindAllDocumentsCount(dbName,collectionName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$storage = $storageService->findAllDocumentsCount($dbName,$collectionName); 
print_r("Total Records is : ".$storage->getTotalRecords());
$success = $storage->isResponseSuccess();
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
storageService->FindAllDocumentsCount(dbName, collectionName,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",storageResponse->getTotalRecords());
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
storageService.findAllDocumentsCount(dbName,collectionName, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response); 
		trace("response is : " + storage);
	}  
}  
Coming Soon 

Find All Documents Paging

Find all documents stored in the given database and collection by paging.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. max - Maximum number of records to be fetched. offset - From where the records are to be fetched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
int max = 1;
int offset = 0 ;
storageService.findAllDocuments(dbName, collectionName, max, offset, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
System.out.println("Exception Message"+ex.getMessage());	
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
int max = 1;
int offset = 0 ;
storageService.FindAllDocuments(dbName,collectionName,max,offset, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
int max = 1;
int offset = 0 ;
Storage *storage = [storageService findAllDocuments:dbName collectionName:collectionName max:max offset:offset]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Integer max = new Integer(1);
Integer offset = new Integer(0);  
Storage storage = storageService.findAllDocuments(dbName,collectionName,max,offset);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
int max = 1;
int offset = 0 ;
Storage storage = storageService.findAllDocuments(dbName,collectionName,max,offset);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
int max = 1;
int offset = 0 ;
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindAllDocuments(dbName, collectionName, max, offset, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
max = 1,
offset = 0,
response ;  
storageService.findAllDocumentsByPaging(dbName,collectionName,max,offset,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local max = 5
local offset = 0
local App42CallBack = {}
storageService:findAllDocumentsByPaging(dbName, collectionName,max,offset,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
int max = 2;
int offset = 0;
storageService->FindAllDocuments(dbName, collectionName,max,offset,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            printf("\n RecordCount=%lf\n",it->recordCount);
            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
            	printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
int max = 1;
int offset = 0 ;
Storage storage = storageService.FindAllDocuments(dbName,collectionName,max,offset);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}     
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$max = 1;
$offset = 0 ;
$storage = $storageService->findAllDocuments($dbName,$collectionName,$max,$offset); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
int max = 2;
int offset = 0;
storageService->FindAllDocuments(dbName, collectionName,max,offset,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            printf("\n RecordCount=%lf\n",it->recordCount);
            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
            	printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var max:int = 1;
var offset:int = 0 ;
storageService.findAllDocumentsByPaging(dbName,collectionName,max,offset, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Find Document By Id

Find a target document by giving unique object id.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. docId - Unique Object Id handler.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
storageService.findDocumentById(dbName, collectionName, docId, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());		
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
storageService.FindDocumentById(dbName,collectionName,docId, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *docId = @"docId";
Storage *storage = [storageService findDocumentById:dbName collectionName:collectionName docId:docId]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Storage storage = storageService.findDocumentById(dbName,collectionName,docId);  
System.out.println("dbName is " + storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Storage storage = storageService.findDocumentById(dbName,collectionName,docId);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindDocumentById(dbName,collectionName,docId, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
response ;  
storageService.findDocumentById(dbName,collectionName,docId,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local App42CallBack = {}
storageService:findDocumentById(dbName, collectionName,docId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("CreatedAt is "..object:getJsonDocList():getCreatedAt())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";    
const char* docId = "docId";
storageService->FindDocumentById(dbName, collectionName, docId, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Storage storage = storageService.FindDocumentById(dbName,collectionName,docId);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId = "docId";
$storage = $storageService->findDocumentById($dbName,$collectionName,$docId); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";    
const char* docId = "docId";
storageService->FindDocumentById(dbName, collectionName, docId, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var docId:String = "docId";
storageService.findDocumentById(dbName,collectionName,docId, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Find Document By Key Value

Find all documents stored in the given database and collection by using key value search parameter.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. key - Key to be searched for the target JSON doc. value - Value to be searched for the target JSON doc.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
storageService.findDocumentByKeyValue(dbName, collectionName, key, value, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
storageService.FindDocumentByKeyValue(dbName,collectionName,key,value, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *key = @"name"; 
NSString *value = @"Nick"; 
Storage *storage = [storageService findDocumentByKeyValue:dbName collectionName:collectionName key:key value:value]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);  
System.out.println("dbName is " + storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindDocumentByKeyValue(dbName, collectionName, key, value, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "key",
value = "value",
response ;  
storageService.findDocumentByKeyValue(dbName,collectionName,key,value,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local App42CallBack = {}
storageService:findDocumentByKeyValue(dbName, collectionName,key,value,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key = "name";
const char* value = "Nick";
storageService->FindDocumentByKeyValue(dbName, collectionName,key,value,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(cocos2d::CCNode *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    
    for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
    {
        printf("\n Data Base Name=%s",it->dbName.c_str());
        printf("\n Collection Name=%s\n",it->collectionName.c_str());
    }
    
    for(std::vector<JSONDocument>::iterator it = storageResponse->documents.begin(); it != storageResponse->documents.end(); ++it)
    {
        printf("\n DocId=%s",it->docId.c_str());
        printf("\n Json =%s\n",it->jsonDoc.c_str());
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Storage storage = storageService.FindDocumentByKeyValue(dbName,collectionName,key,value);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>";
$key = "name"; 
$value = "Nick"; 
$storage = $storageService->findDocumentByKeyValue($dbName,$collectionName,$key,$value); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key = "name";
const char* value = "Nick";
storageService->FindDocumentByKeyValue(dbName, collectionName,key,value,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(cocos2d::CCNode *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    
    for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
    {
        printf("\n Data Base Name=%s",it->dbName.c_str());
        printf("\n Collection Name=%s\n",it->collectionName.c_str());
    }
    
    for(std::vector<JSONDocument>::iterator it = storageResponse->documents.begin(); it != storageResponse->documents.end(); ++it)
    {
        printf("\n DocId=%s",it->docId.c_str());
        printf("\n Json =%s\n",it->jsonDoc.c_str());
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key:String = "name"; 
var value:String = "Nick"; 
storageService.findDocumentByKeyValue(dbName,collectionName,key,value,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Find Document By Query

Find target documents using Custom Query.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. query - Query Object containing custom query for searching docs.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
storageService.findDocumentsByQuery(dbName, collectionName, query, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";   
String key2 = "age";     
int value2 = 30;    
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.	   
storageService.FindDocumentsByQuery(dbName, collectionName, query,new Callback());
//This will return JSONObject list, there might be single or multiple objects if more than one object found
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *key1 = @"name"; 
NSString *value1 = @"Nick"; 
NSString *key2 = @"age"; 
NSNumber *value2= [NSNumber numberWithInt:30];
Query *q1 = [QueryBuilder buildQueryWithKey:key1 value:value1 operator:APP42_OP_EQUALS]; // Build query q1 for key1 equal to name and value1 equal to Nick
Query *q2 = [QueryBuilder buildQueryWithKey:key2 value:value2 operator:APP42_OP_GREATER_THAN]; // Build query q2 for key2 equal to age and value2 equal to 30	 
Query *query = [QueryBuilder combineQuery:q1 withQuery:q2 usingOperator:APP42_OP_OR]; 
Storage *storage = [storageService findDocumentsByQuery:query dbName:dbName collectionName:collectionName];
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";    
String key2 = "age";    
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,query);
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,query);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";      
String key2 = "age";  
int value2 = 30;    
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindDocumentsByQuery(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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key1 = "name",  
value1 = "Nick",   
key2 = "age",
value2 = 30,  
response ;
var queryBuilder = new QueryBuilder();
var q1= queryBuilder.build(key1, value1, Operator.EQUALS);    
var q2 = queryBuilder.build(key2, value2, Operator.GREATER_THAN);		
var query = queryBuilder.compoundOperator(q1,Operator.OR, q2);   	
storageService.findDocumentsByQuery(dbName, collectionName, query,{
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
});         
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local key1 = "age"
local value1 = 30
local q1 = queryBuilder:build(key, value, Operator.EQUALS)   
local q2 = queryBuilder:build(key1, value1, Operator.GREATER_THAN)		
local query = queryBuilder:compoundOperator(q1,Operator.OR, q2)
local App42CallBack = {}
storageService:findDocumentsByQuery(dbName, collectionName,query,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
		for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
storageService->FindDocumentByQuery(dbName, collectionName,query3,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Event=%s",iit->getEvent().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;    
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
Storage storage = storageService.FindDocumentsByQuery(dbName,collectionName,query);
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Enter_the_dbName>";  
$collectionName = "<Your_Collection_Name>";    
$key1 = "name";   
$value1 = "Nick";   
$key2 = "age";     
$value2 = 30;    
$queryBuilder = new QueryBuilder();
$q1 = $queryBuilder->build($key1, $value1, Operator::EQUALS);  // Build query q1 for key1 equal to name and value1 equal to Nick
$q2 = $queryBuilder->build($key2, $value2, Operator::GREATER_THAN);  // Build query q2 for key2 equal to age and value2 equal to 30
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);  	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.	
$storage = $storageService->findDocumentsByQuery($dbName,$collectionName,$query);
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString();
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
storageService->FindDocumentByQuery(dbName, collectionName,query3,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Event=%s",iit->getEvent().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Enter_the_dbName>";
var collectionName:String = "<Your_Collection_Name>";
var key1:String = "name";
var value1:String = "Nick";
var key2:String = "age";
var value2:int = 30;
var q1:Query = QueryBuilder.build(key1, value1, Operator.EQUALS);
var q2:Query = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);
var query:Query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);
storageService.findDocumentsByQuery(dbName, collectionName, query,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
} 
Coming Soon 

Find Document By Query Paging

Find target documents using Custom Query with paging.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. query - Query Object containing custom query for searching docs. max - max result parameter. offset - offset result parameter.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";
String key2 = "age";        
int value2 = 30;    
int max = 1;    
int offset = 0;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
storageService.findDocumentsByQueryWithPaging(dbName, collectionName, query, max, offset, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});   
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";  
String value1 = "Nick";   
String key2 = "age";      
int value2 = 30;       
int max = 1;        
int offset = 0;       
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.	   
storageService.FindDocumentsByQuery(dbName,collectionName,query,max,offset,new Callback());
//This will return JSONObject list, there might be single or multiple objects if more than one object found
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *key1 = @"name"; 
NSString *value1 = @"Nick"; 
NSString *key2 = @"age"; 
NSNumber *value2= [NSNumber numberWithInt:30];    
int max = 1;        
int offset = 0;       
Query *q1 = [QueryBuilder buildQueryWithKey:key1 value:value1 operator:APP42_OP_EQUALS]; // Build query q1 for key1 equal to name and value1 equal to Nick
Query *q2 = [QueryBuilder buildQueryWithKey:key2 value:value2 operator:APP42_OP_GREATER_THAN]; // Build query q2 for key2 equal to age and value2 equal to 30	 
Query *query = [QueryBuilder combineQuery:q1 withQuery:q2 usingOperator:APP42_OP_OR]; 
Storage *storage = [storageService findDocumentsByQuery:query dbName:dbName collectionName:collectionName max:max offset:offset];
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;  
Integer max = new Integer(1);
Integer offset = new Integer(0);    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,query,max,offset);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}          
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;         
int max = 1;        
int offset = 0;     
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,query,max,offset);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;        
int max = 1;        
int offset = 0;    
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindDocumentsByQuery(dbName, collectionName, query, max, offset, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key1 = "name",
value1 = "age",     
key2 = "Nick",
value2 = 30,        
max = 1,        
offset = 0,    
response ;
var queryBuilder = new QueryBuilder();
var q1 = queryBuilder.build(key1, value1, Operator.EQUALS);    
var q2 = queryBuilder.build(key2, value2, Operator.GREATER_THAN);		
var query = queryBuilder.compoundOperator(q1,Operator.OR, q2);   	
storageService.findDocumentsByQuery(dbName, collectionName, query, max, offset,{
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
});         
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local key1 = "age"
local value1 = 30
local max = 5
local offset = 0
local q1 = queryBuilder:build(key, value, Operator.EQUALS)   
local q2 = queryBuilder:build(key1, value1, Operator.GREATER_THAN)		
local query = queryBuilder:compoundOperator(q1,Operator.OR, q2)
local App42CallBack = {}
storageService:findDocumentsByQueryWithPaging(dbName, collectionName,query,max,offset,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
		for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";

Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
int max =2;
int offset = 0;
storageService->FindDocumentsByQueryWithPaging(dbName, collectionName,query3,max,offset,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Event=%s",iit->getEvent().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value = "Nick";     
String key2 = "age";   
int value1 = 30;        
int max = 1;        
int offset = 0;    
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
Storage storage = storageService.FindDocumentsByQuery(dbName,collectionName, query, max, offset);
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}  
$dbName = "<Enter_the_dbName>";  
$collectionName = "<Your_Collection_Name>";    
$key1 = "name";  
$value1 = "Nick";   
$key2 = "age";      
$value2 = 30;     
$max = 1;    
$offset = 30;    
$queryBuilder = new QueryBuilder();
$q1 = $queryBuilder->build($key1, $value1, Operator::EQUALS);  // Build query q1 for key1 equal to name and value1 equal to Nick
$q2 = $queryBuilder->build($key2, $value2, Operator::GREATER_THAN);  // Build query q2 for key2 equal to age and value2 equal to 30
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);  	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.	
$storage = $storageService->findDocumentsByQuery($dbName,$collectionName,$query,$max,$offset);
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
print_r("Record Count :".$storage->getRecordCount());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString();
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";

Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
int max =2;
int offset = 0;
storageService->FindDocumentsByQueryWithPaging(dbName, collectionName,query3,max,offset,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Event=%s",iit->getEvent().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
Coming Soon
Coming Soon 

Find Docs With Query Paging Order By

Find target documents using Custom Query with paging and orderby.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. query - Query Object containing custom query for searching docs. max - max result parameter. offset - offset result parameter. key - Key to be searched for the target JSON doc. type - Sorts the document by its type either ASCENDING or DESCENDING.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";
String key2 = "age";        
int value2 = 30;    
int max = 1;    
int offset = 0;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
storageService.findDocsWithQueryPagingOrderBy(dbName,collectionName, query, max, offset, key1 , OrderByType.ASCENDING ,new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});   
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";  
String value1 = "Nick"; 
String key2 = "age";        
int value2 = 30;       
int max = 1;        
int offset = 0;       
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   
// Pass aggregated query  to finder method below. Similarly you can aggregate more conditions in querying object.	   
storageService.FindDocsWithQueryPagingOrderBy(dbName,collectionName,query,max,offset,key1,OrderByType.ASCENDING,new Callback());
//This will return JSONObject list, there might be single or multiple objects if more than one object found
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *key1 = @"name"; 
NSString *value1 = @"Nick"; 
NSString *key2 = @"age"; 
NSNumber *value2 = [NSNumber numberWithInt:30];    
int max = 1;        
int offset = 0;       
Query *q1 = [QueryBuilder buildQueryWithKey:key1 value:value1 operator:APP42_OP_EQUALS]; // Build query q1 for key1 equal to name and value1 equal to Nick
Query *q2 = [QueryBuilder buildQueryWithKey:key2 value:value2 operator:APP42_OP_GREATER_THAN]; // Build query q2 for key2 equal to age and value2 equal to 30	 
Query *query = [QueryBuilder combineQuery:q1 withQuery:q2 usingOperator:APP42_OP_OR]; 
Storage *storage = [storageService findDocsWithQueryPagingOrderBy:query dbName:dbName collectionName:collectionName max:max offset:offset orderByKey:key1 orderByType:APP42_ORDER_ASCENDING];
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;  
Integer max = new Integer(1);
Integer offset = new Integer(0);    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
Storage storage = storageService.findDocsWithQueryPagingOrderBy(dbName,collectionName,query,max,offset,key1,OrderByType.ASCENDING);
System.out.println("dbName is " + storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());  
}         
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";      
String key2 = "age";  
int value2 = 30;         
int max = 1;        
int offset = 0;     
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
Storage storage = storageService.findDocsWithQueryPagingOrderBy(dbName,collectionName, query, max,offset,key1,OrderByType.ASCENDING);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";   
String key2 = "age";     
int value2 = 30;        
int max = 1;        
int offset = 0;    
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
App42Log.SetDebug(true);		//Print output in your editor console
storageService.FindDocsWithQueryPagingOrderBy(dbName, collectionName, query, max, offset, key1, OrderByType.ASCENDING, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key1 = "name", 
value1 = "age", 
key2 = "Nick",   
value2 = 30,        
max = 1,        
offset = 0,    
response ;
var queryBuilder = new QueryBuilder();
var q1 = queryBuilder.build(key1, value2, Operator.EQUALS);    
var q2 = queryBuilder.build(key2, value2, Operator.GREATER_THAN);		
var query = queryBuilder.compoundOperator(q1,Operator.OR, q2);   	
storageService.findDocsWithQueryPagingOrderBy(dbName, collectionName, query,max,offset,key1,OrderByType.ASCENDING,{
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
});         
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local key1 = "age"
local value1 = 30
local max = 5
local offset = 0
local q1 = queryBuilder:build(key, value, Operator.EQUALS)   
local q2 = queryBuilder:build(key1, value1, Operator.GREATER_THAN)		
local query = queryBuilder:compoundOperator(q1,Operator.OR, q2)
local App42CallBack = {}
storageService:findDocsWithQueryPagingOrderBy(dbName, collectionName,query,max,offset,key,OrderByType.ASCENDING,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
		for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
int max =2;
int offset = 0;
storageService->FindDocsWithQueryPagingOrderBy(dbName, collectionName,query3,max,offset,key1,APP42_ORDER_ASCENDING,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";  
String value1 = "Nick";    
String key2 = "age";     
int value2 = 30;        
int max = 1;        
int offset = 0;    
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);   	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.  
Storage storage = storageService.FindDocsWithQueryPagingOrderBy(dbName,collectionName,query,max,offset,key1,OrderByType.ASCENDING);
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Enter_the_dbName>";  
$collectionName = "<Your_Collection_Name>";    
$key1 = "name";   
$value1 = "Nick";     
$key2 = "age";   
$value2 = 30;     
$max = 1;    
$offset = 30;    
$queryBuilder = new QueryBuilder();
$q1 = $queryBuilder->build($key1, $value1, Operator::EQUALS);  // Build query q1 for key1 equal to name and value1 equal to Nick
$q2 = $queryBuilder->build($key2, $value2, Operator::GREATER_THAN);  // Build query q2 for key2 equal to age and value2 equal to 30
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);  	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.	
$storage = $storageService->findDocsWithQueryPagingOrderBy($dbName,$collectionName,$query,$max,$offset,$key2,OrderByType::ASCENDING);
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString();
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
int max =2;
int offset = 0;
storageService->FindDocsWithQueryPagingOrderBy(dbName, collectionName,query3,max,offset,key1,APP42_ORDER_ASCENDING,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
Coming Soon
Coming Soon 

Update Document By Key Value WIth JSON String

Update target document using a key value search parameter. This key value pair will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. key - Key to be searched for the target JSON doc. value - Value to be searched for the target JSON doc. jsonDoc - Complete json document with updated value.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.updateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.UpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *key = @"name"; 
NSString *value = @"Nick"; 
NSString *jsonDoc = @"{\"Company\":\"Shephertz Technologies\"}";
Storage *storage = [storageService updateDocumentByKeyValue:dbName collectionName:collectionName key:key value:value jsonDoc:jsonDoc]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.UpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "name",
value = "Nick",
jsonDoc = "{\"Company\":\"Shephertz Technologies\"}",
response ;  
storageService.updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local jsonDoc = "{\"Company\":\"Shephertz Technologies\"}"
local App42CallBack = {}
storageService:updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
		for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key = "name";
const char* value = "Nick";
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->UpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.UpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key = "name"; 
$value = "Nick"; 
$jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
$storage = $storageService->updateDocumentByKeyValue($dbName,$collectionName,$key,$value,$jsonDoc); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>"; 
const char* key = "name";
const char* value = "Nick";
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->UpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
Not Available 
Coming Soon 

Update Document By Key Value WIth JSON Object

Update target document using a key value search parameter. This key value pair will be searched in the JSON doc stored in the cloud and matching doc will be updated with new value passed. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. key - Key to be updated for the target JSON doc. value - Value to be updated for the target JSON doc. jsonDoc - Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
storageService.updateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JObject jsonDoc = new JObject();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
storageService.UpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *key = @"name"; 
NSString *value = @"Nick";
NSDictionary *jsonDoc = [NSDictionary dictionaryWithObjectsAndKeys:@"John",@"name", nil];
Storage *storage = [storageService updateDocumentByKeyValue:dbName collectionName:collectionName key:key value:value jsonDoc:jsonDoc]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
Storage storage = storageService.updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
Storage storage = storageService.updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42Log.SetDebug(true);		//Print output in your editor console
storageService.UpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "name",
value = "Nick",
response ;  
var jsonDoc = new Object();
jsonDoc.name = "John";
jsonDoc.type = "20";
storageService.updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log("dbName is :" +storageObj.app42.response.storage.dbName)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local jsonDoc = {}
jsonDoc.name = "John"
jsonDoc.age = 20
local App42CallBack = {}
storageService:updateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
		for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->UpdateDocumentByKeyValue(dbName, collectionName, key, value, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick";  
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
Storage storage = storageService.UpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc);  
Console.WriteLine("dbName is :: " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key = "name"; 
$value = "Nick"; 
$jsonDoc = new JSONObject();
$jsonDoc->put("name","John");
$jsonDoc->put("age",20);
$storage = $storageService->updateDocumentByKeyValue($dbName,$collectionName,$key,$value,$jsonDoc); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->UpdateDocumentByKeyValue(dbName, collectionName, key, value, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Not Available
var dbName:String  = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key:String = "<Enter_the_key>"; 
var value:String = "<Enter_the_value>"; 
var jsonDoc:Object  = new Object();
jsonDoc.name = "John"; 
jsonDoc.age = 20; 
storageService.updateDocumentByKeyValueWithJsonObject(dbName,collectionName,key,value ,jsonDoc ,new callback());	
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("dbName is " + storage.getDbName());
		trace("Collection Name is :  " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}
Coming Soon 

Update Document By Doc Id With JSON String

Update target document using the document id. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. docId - Id of the document to be updated for the target JSON doc. jsonDoc - Complete Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.updateDocumentByDocId(dbName, collectionName, docId, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.UpdateDocumentByDocId(dbName,collectionName,docId,jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
String *docId = @"docId";
NSString *jsonDoc = @"{\"Company\":\"Shephertz Technologies\"}";
Storage *storage = [storageService updateDocumentByDocId:dbName collectionName:collectionName docId:docId jsonDoc:jsonDoc]; 
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is = %@ " , jsonDoc.docId);  
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc); 
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.updateDocumentByDocId(dbName,collectionName,docId,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.updateDocumentByDocId(dbName,collectionName,docId,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.UpdateDocumentByDocId(dbName, collectionName, docId, jsonDoc, 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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
jsonDoc = "{\"Company\":\"Shephertz Technologies\"}",
response ;  
storageService.updateDocumentByDocId(dbName,collectionName,docId,jsonDoc,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local jsonDoc = "{\"Company\":\"Shephertz Technologies\"}"
local App42CallBack = {}
storageService:updateDocumentByDocId(dbName,collectionName,docId,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("CreatedAt is "..object:getJsonDocList():getCreatedAt())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->UpdateDocumentByDocId(dbName, collectionName, docId, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.UpdateDocumentByDocId(dbName,collectionName,docId,jsonDoc);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
	Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>";
$docId = "docId";
$jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
$storage = $storageService->updateDocumentByDocId($dbName,$collectionName,$docId,$jsonDoc); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->UpdateDocumentByDocId(dbName, collectionName, docId, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
Not Available
Coming Soon 

Delete Document By Doc Id

Delete target document using Object Id from the given database and collection. The Object Id will be searched in the JSON doc stored in the cloud and matching Doc will be deleted.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be deleted. docId - Unique Object Id handler.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
storageService.deleteDocumentById(dbName, collectionName, docId, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
String dbName = "<Enter_the_dbName>"; 
String collectionName = "<Your_Collection_Name>";  
String docId = "docId";
storageService.DeleteDocumentById(dbName,collectionName,docId, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response success = (App42Response) response;     
		String jsonResponse = success.ToString();  
	}  
}  
NSString *dbName = @"<Enter_the_dbName>"; 
NSString *collectionName = @"<Your_Collection_Name>";  
String *docId = @"docId";
App42Response *response = [storageService deleteDocumentById:dbName collectionName:collectionName docId:docId]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
App42Response response = storageService.deleteDocumentById(dbName,collectionName,docId);
System.out.println("response is " + response) ;   
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
App42Response app42response = storageService.deleteDocumentById(dbName,collectionName,docId);
System.out.println("response is " + app42response) ;  
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.DeleteDocumentById(dbName, collectionName, docId, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response success = (App42Response) response;     
		String jsonResponse = success.ToString();  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
response ;  
storageService.deleteDocumentById(dbName,collectionName,docId,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local App42CallBack = {}
storageService:deleteDocumentById(dbName,collectionName,docId,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
storageService->DeleteDocumentsById(dbName, collectionName,docId,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
App42Response response = storageService.DeleteDocumentById(dbName,collectionName,docId); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId = "docId";
$response = $storageService->deleteDocumentById($dbName,$collectionName,$docId); 
print_r("Response is : ".$storage->toString());
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
storageService->DeleteDocumentsById(dbName, collectionName,docId,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var docId:String = "docId";
storageService.deleteDocumentById(dbName,collectionName,docId,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response); 
		trace("response is : " + storage);
	}  
}  
Coming Soon 

Insert json Doc Using Map

Save the JSON document in giving database name and collection name. It accepts the HashMap containing key-value and convert it into JSON. Converted JSON doc further saved in the cloud using given database name and collection name.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc has to be saved. map - HashMap containing key-value pairs.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
HashMap<String, String> map = new HashMap< String, String >();
map.put("Company", "Shephertz");					
storageService.insertJsonDocUsingMap(dbName, collectionName, map ,new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Dictionary<String, String> map = new Dictionary<String, String>();
map.Add("Company", "Shephertz");
storageService.InsertJsonDocUsingMap(dbName, collectionName, map, new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList();            
		for(int i=0; i<jsonDocList.Count; i++)
		{
			Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());  
			Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
			Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
			Console.WriteLine("Jsondoc is " + jsonDocList[i].GetJsonDoc());  
		} 		
		String jsonResponse = storage.ToString();  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:@"Shephertz" forKey:@"Company"];
Storage *storage = [storageService insertJsonDocUsingMap:dbName collectionName:collectionName map:dict];  
NSLog(@"dbName is = %@",storage.dbName);
NSLog(@"collectionName is = %@",storage.collectionName);
NSString *jsonResponse = [storage toString]; 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Hashtable map = new Hashtable();
map.put("Company", "Shephertz");					
Storage storage = storageService.insertJsonDocUsingMap(dbName,collectionName,map);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}         
String jsonResponse = storage.toString();     
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
HashMap< String, String > map = new HashMap< String, String >();
map.put("Company", "Shephertz");					
Storage storage = storageService.insertJsonDocUsingMap(dbName,collectionName,map);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
} 
String jsonResponse = storage.toString();        
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Dictionary< String, String > map = new Dictionary< String, String >();
map.Add("Company", "Shephertz");
App42Log.SetDebug(true);		//Print output in your editor console
storageService.InsertJsonDocUsingMap(dbName,collectionName,map, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available       
Coming Soon
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Dictionary< String, String > map = new Dictionary< String, String >();
map.Add("Company", "Shephertz");
Storage storage = storageService.InsertJsonDocUsingMap(dbName,collectionName,map);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("Collection Name is " + storage.GetCollectionName());
String jsonResponse = storage.ToString();        
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$map = array("Company" => "Shephertz");						
$storage = $storageService->insertJsonDocUsingMap($dbName, $collectionName,$map);  
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is " . $storage->getCollectionName());
$jsonResponse = $storage->toString(); 
Coming Soon
Coming Soon
Coming Soon
Coming Soon 

Map Reduce

Map reduce function to search the target document. Please see detailed information on map-reduce http://en.wikipedia.org/wiki/MapReduce .

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. mapFunction - Map function to be used to search the document. reduceFunction - Reduce function to be used to search the document.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String mapFunction = "function map(){ emit(this.user,1);}";
String reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";		 
storageService.mapReduce(dbName, collectionName, mapFunction, reduceFunction, new App42CallBack() {
public void onSuccess(Object response) 
{
	String  storage  = (String )response;
	System.out.println(storage);
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String mapFunction = "function map(){ emit(this.user,1);}";
String reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";		 
storageService.MapReduce(dbName, collectionName, mapFunction, reduceFunction,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		String storage = (String) response;  
		Console.WriteLine("Response Is :: " + storage); 
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *mapFunction = @"function map(){ emit(this.user,1);}";
NSString *reduceFunction = @"function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";		 
NSString *response = [storageService mapReduce:dbName collectionName:collectionName mapFunction:mapFunction reduceFunction:reduceFunction]
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String mapFunction = "function map(){ emit(this.user,1);}";
String reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";		 
String response = storageService.mapReduce(dbName, collectionName, mapFunction, reduceFunction);  
System.out.println(response);
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String mapFunction = "function map(){ emit(this.user,1);}";
String reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";		 
String storage = storageService.mapReduce(dbName, collectionName, mapFunction, reduceFunction);  
System.out.println(storage);
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String mapFunction = "function map(){ emit(this.user,1);}";
String reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";	
App42Log.SetDebug(true);		//Print output in your editor console	 
storageService.MapReduce(dbName, collectionName, mapFunction, reduceFunction, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available      
Coming Soon
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String mapFunction = "function map(){ emit(this.user,1);}";
String reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";		 
String response = storageService.MapReduce(dbName, collectionName, mapFunction, reduceFunction);
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$mapFunction = "function map(){ emit(this.user,1);}";
$reduceFunction = "function reduce(key, val){var sum = 0; for(var n=0;n< val.length;n++){ sum = sum + val[n]; } return sum;}";
$response = $storageService-> mapReduce($dbName, $collectionName, $mapFunction, $reduceFunction);
Coming Soon
Coming Soon
Coming Soon
Coming Soon 

Delete All Documents

Delete all documents from selected database and collectionName.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which the documents need to be searched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
storageService.deleteAllDocuments(dbName, collectionName, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Enter_the_dbName>"; 
String collectionName = "<Your_Collection_Name>";  
storageService.DeleteAllDocuments(dbName, collectionName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{ 
		App42Response success = (App42Response) response;     
		String jsonResponse = success.ToString();  
	}  
} 
NSString *dbName = @"<Enter_the_dbName>"; 
NSString *collectionName = @"<Your_Collection_Name>";  
App42Response *response = [storageService deleteAllDocuments:dbName collectionName:collectionName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Response response = storageService.deleteAllDocuments(dbName,collectionName);
System.out.println("response is " + response) ; 
boolean response = response.isResponseSuccess();
String jsonResponse = response.toString();
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Response app42response = storageService.deleteAllDocuments(dbName,collectionName);
System.out.println("response is " + app42response) ; 
boolean success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString();
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Log.SetDebug(true);		//Print output in your editor console
storageService.DeleteAllDocuments(dbName,collectionName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response success = (App42Response) response;     
		String jsonResponse = success.ToString();  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
response; 
storageService.deleteAllDocuments(dbName, collectionName,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName);
	},  
	error: function(error) {  
	}  
});
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local App42CallBack = {}
storageService:deleteAllDocuments(dbName,collectionName,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
storageService->DeleteAllDocuments(dbName, collectionName,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Response response = storageService.DeleteAllDocuments(dbName,collectionName);
Boolean response = response.IsResponseSuccess();
String jsonResponse = response.ToString();
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$storage = $storageService->deleteAllDocuments($dbName, $collectionName);
print_r("Response is : ".$storage->toString());
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
storageService->DeleteAllDocuments(dbName, collectionName,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
storageService.deleteAllDocuments(dbName,collectionName,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response); 
		trace("response is : " + storage);
	}  
}  
Coming Soon 

Find Documents By Location

Find target documents using Custom Geo Query.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which the documents need to be searched. Query - Query Object containing custom Geo query for searching docs.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
GeoTag gp = new GeoTag();
gp.setLat(new BigDecimal(29.685693));
gp.setLng(new BigDecimal(76.990482));
storageService.setGeoTag(gp);
GeoQuery query = QueryBuilder.buildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
storageService.findDocumentsByLocation(dbName, collectionName, query, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
storageService.SetGeoTag(gp);
GeoQuery query = QueryBuilder.BuildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
storageService.FindDocumentsByLocation(dbName, collectionName, query, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
}  
NSString *dbName = @<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
GeoTag *geoTag = [[GeoTag alloc] initWithLatitude:2.0 andLongitude:20.0];
storageServiceObject.geoTag = [geoTag toString];
GeoQuery *query = [QueryBuilder buildGeoQueryWithTag:geoTag andOperator:APP42_OP_NEAR maxDistance:10];
Storage *storage = [storageService findDocumentsByLocation:dbName collectionName:collectionName geoQuery:query];
NSLog(@"dbName is %@" , storage.dbName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;               
for(JSONDocument *jsonDoc in jsonDocArray) 
{  
	NSLog(@"objectId is  %@ " , jsonDoc.docId);          
	NSLog(@"jsonDoc is   %@ " , jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt is %@"  , jsonDoc.updatedAt);
	NSLog(@"CreatedAt is %@"  , jsonDoc.createdAt);
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
GeoTag gp = new GeoTag();
gp.setLat(new Double(-74.2713));  
gp.setLng(new Double(40.73137));  
storageService.setGeoTag(gp);
GeoQuery query = QueryBuilder.buildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
Storage storage =storageService.findDocumentsByLocation(dbName, collectionName, query);
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
GeoTag gp = new GeoTag();
gp.setLat(new BigDecimal(29.685693));
gp.setLng(new BigDecimal(76.990482));
storageService.setGeoTag(gp);
GeoQuery query = QueryBuilder.buildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
Storage storage =storageService.findDocumentsByLocation(dbName, collectionName, query);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
storageService.SetGeoTag(gp);
GeoQuery query = QueryBuilder.BuildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
App42Log.SetDebug(true);		//Print output in your editor console
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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
response;
var gp = new GeoTag();
gp.setLat(-73.1234)
gp.setLng(-26.1234)
storageService.setGeoTag(gp);
var queryBuilder = new QueryBuilder();
var build = queryBuilder.buildGeoQuery(gp, GeoOperator.NEAR, 100);
storageService.findDocumentsByQuery(dbName, collectionName, build,{
	success: function(object) {
	var storageObj = JSON.parse(object);		
	response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{
			console.log(response.loc)
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
		{
			console.log(response[i].loc)
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
		}
	},
	error: function(error1) {
		console.log(error1)
	}		
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local gp = require("App42-Lua-API.GeoTag")
gp:setLat(-73.99171)
gp:setLng(40.738868)
storageService:setGeoTag(gp);
local query = QueryBuilder:buildGeoQuery(gp, GeoOperator.NEAR, 100)
local App42CallBack = {}
storageService:findDocumentsByLocation(dbName, collectionName, query,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName		
	for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";  
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
storageService.SetGeoTag(gp);
GeoQuery query = QueryBuilder.BuildGeoQuery(gp, GeoOperator.NEAR, new BigDecimal(100));
Storage storage =storageService.FindDocumentsByLocation(dbName, collectionName, query);
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$gp = new GeoTag();
$gp->setLat(-73.99171);
$gp->setLng(40.738868);
$storageService->setGeoTag($gp);
$queryBuilder = new QueryBuilder();
$query = $queryBuilder->buildGeoQuery($gp, GeoOperator::NEAR, 100);
$storage = $storageService->findDocumentsByLocation($dbName, $collectionName, $query);
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
	print_r("Lat is ".$jsonDoc->getLocation()->getLat());
	print_r("Lng is ".$jsonDoc->getLocation()->getLng());
} 
Coming Soon
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var gp:GeoTag = new GeoTag();
gp.setLat(-73.99171);
gp.setLng(40.738868);
storageService.setGeoTag(gp);
var query:GeoQuery = QueryBuilder.buildGeoQuery(gp, GeoOperator.NEAR, 100);
storageService.findDocumentsByLocation(dbName, collectionName, query,new callback());
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
			if(jsonDoc.getLocation()!=null)
			{
				trace("Lat is : " + jsonDoc.getLocation().getLat());
				trace("Lng is : " + jsonDoc.getLocation().getLng());
			}
		}
	}  
}  
Coming Soon 

Delete Documents By Key Value

Delete target document using key and value from the given database and collection. The key value will be searched in the JSON doc stored in the cloud and matching value will be deleted.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be deleted. key - Key to be searched for target JSON document which has to be deleted. value - Value to be searched for target JSON document which has to be deleted.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"
String key = "name"; 
String value = "Nick"; 	
storageService.deleteDocumentsByKeyValue(dbName, collectionName, key, value, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String dbName = "<Enter_the_dbName>"; 
String collectionName = "<Your_Collection_Name>";  
String key = "name"; 
String value = "Nick"; 	
storageService.DeleteDocumentsByKeyValue(dbName, collectionName, key, value, new Callback());  
new Callback()


public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response success = (App42Response) response;     
		String jsonResponse = success.ToString();  
	}  
}
NSString *dbName = @"<Enter_the_dbName>"; 
NSString *collectionName = @"<Your_Collection_Name>";  
NSString *key = @"name";
NSString *value = @"Nick";
App42Response *response = [storageService deleteDocumentsByKeyValue:dbName collectionName:collectionName key:key value:value];
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 	
App42Response response = storageService.deleteDocumentsByKeyValue(dbName,collectionName, key,value);
System.out.println("response is " + response) ;  
boolean  response = response.isResponseSuccess();
String jsonResponse = response.toString();
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 	
App42Response app42response = storageService.deleteDocumentsByKeyValue(dbName,collectionName, key,value);
System.out.println("response is " + app42response) ;  
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString();
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 	
App42Log.SetDebug(true);		//Print output in your editor console
storageService.DeleteDocumentsByKeyValue(dbName,collectionName, key,value, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response success = (App42Response) response;     
		String jsonResponse = success.ToString();  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "key",
value = "Nick",
response; 
storageService.deleteDocumentsByKeyValue(dbName, collectionName,key,value,{  
	success: function(object) 
	{  
		var storage = JSON.parse(object);  
		response = storage.app42.response;
		console.log("response is " + response)
	},  
	error: function(error) {  
	}  
});
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local App42CallBack = {}
storageService:deleteDocumentsByKeyValue(dbName,collectionName,key,value,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
storageService->DeleteDocumentsByKeyValue(dbName, collectionName,key,value,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 	
App42Response response = storageService.DeleteDocumentsByKeyValue(dbName,collectionName, key,value);
Boolean  response = response.IsResponseSuccess();
String jsonResponse = response.ToString();
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key = "name"; 
$value = "Nick"; 
$storage = $storageService->&gt;deleteDocumentsByKeyValue($dbName , $collectionName, $key, $value);
print_r("Response is : ".$storage->toString());
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
storageService->DeleteDocumentsByKeyValue(dbName, collectionName,key,value,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key:String = "name"; 
var value:String = "Nick"; 
storageService.deleteDocumentsByKeyValue(dbName,collectionName, key,value,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response); 
		trace("response is : " + storage);
	}  
}  
Coming Soon 

Revoke Access On Doc

This function allows you to revoke permission specified in the ACL list for a user on a given document id.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be revoked. docId - Unique Object Id handler. aclList - object contains the username and the permission to be granted/ revoked. The Default user name in aclList is set to PUBLIC. In this case, permission is granted/ revoked from all the users accessing the service.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.add(new ACL("PUBLIC", Permission.READ));  
storageService.revokeAccessOnDoc(dbName, collectionName, docId, aclSet, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
IList<ACL> aclSet = new List<ACL>();
aclSet.Add(new ACL("PUBLIC", Permission.READ));
storageService.RevokeAccessOnDoc(dbName, collectionName, docId, aclSet, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}
	}  
} 
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *docId = @"docId";
ACL *acl = [[ACL alloc] initWithUserName:@"PUBLIC" andPermission:APP42_READ];
NSArray *aclList = [NSArray arrayWithObject:acl];
Storage *storage = [storageService revokeAccessOnDoc:dbName collectionName:collectionName docId:docId andAclList:aclList];

NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" ,  storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
    NSLog(@"objectId is = %@ ", jsonDoc.docId);
    NSLog(@"jsonDoc is  = %@ ", jsonDoc.jsonDoc);
    NSLog(@"UpdatedAt   = %@ ", jsonDoc.updatedAt);
    NSLog(@"CreatedAt   = %@ ", jsonDoc.createdAt);   
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Hashtable aclSet = new Hashtable();
aclSet.put("PUBLIC", ACL.PERMISSION_READ);
Storage storage = storageService.revokeAccessOnDoc(dbName, collectionName, docId, aclSet);
System.out.println("dbName is "+ storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId()); 
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.add(new ACL("PUBLIC", Permission.READ));  
Storage storage = storageService.revokeAccessOnDoc(dbName, collectionName, docId, aclSet);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.Add(new ACL("PUBLIC", Permission.READ));
App42Log.SetDebug(true);		//Print output in your editor console
storageService.RevokeAccessOnDoc(dbName, collectionName, docId, aclSet, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
response ;  
var aclList = new Array();
var point1={
user:"PUBLIC",
permission:Permission.READ,
};
storageService.revokeAccessOnDoc(dbName, collectionName,docId, aclList,{  
success: function(object) 
	{  
	var storage = JSON.parse(object);  
	response = storage.app42.response.storage;
	console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
});
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local aclList = {}
local acl  = ACL:new()
acl:setUser("PUBLIC")
acl:setPermission(Permission.READ)
aclList[1] = acl
local App42CallBack = {}
storageService:revokeAccessOnDoc(dbName,collectionName,docId, aclList,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.Add(new ACL("PUBLIC", Permission.READ));
Storage storage = storageService.RevokeAccessOnDoc(dbName, collectionName, docId, aclSet);
Console.WriteLine("dbName is " + storage.GetDbName());		
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId = "docId";
$aclSet = array();
array_push($aclSet, new ACL("PUBLIC", Permission::READ));
$storage= $storageService->revokeAccessOnDoc($dbName, $collectionName, $docId, $aclSet); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
Coming Soon
Coming Soon
Coming Soon
Coming Soon 

Grant Access On Doc

This function allows you to grant permission specified in the ACL list to a user on a given document id.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be granted. docId - Unique Object Id handler. aclList - object contains the username and the permission to be granted/ revoked. The Default user name in aclList is set to PUBLIC. In this case, permission is granted/ revoked from all the users accessing the service.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.add(new ACL("PUBLIC", Permission.READ));  
storageService.grantAccessOnDoc(dbName, collectionName, docId, aclSet, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
IList<ACL> aclSet = new List<ACL>();
aclSet.Add(new ACL("PUBLIC", Permission.READ));
storageService.GrantAccessOnDoc(dbName, collectionName, docId, aclSet, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
} 
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *docId = @"docId";
ACL *acl = [[ACL alloc] initWithUserName:@"PUBLIC" andPermission:APP42_READ];
NSArray *aclList = [NSArray arrayWithObject:acl];
Storage *storage = [storageService grantAccessOnDoc:dbName collectionName:collectionName docId:docId andAclList:aclList];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" ,  storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
    NSLog(@"objectId is = %@ ", jsonDoc.docId);
    NSLog(@"jsonDoc is  = %@ ", jsonDoc.jsonDoc);
    NSLog(@"UpdatedAt   = %@ ", jsonDoc.updatedAt);
    NSLog(@"CreatedAt   = %@ ", jsonDoc.createdAt);
}

String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Hashtable aclSet = new Hashtable();
aclSet.put("PUBLIC", ACL.PERMISSION_READ);
Storage storage = storageService.grantAccessOnDoc(dbName, collectionName, docId, aclSet);
System.out.println("dbName is "+ storage.getDbName());

Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId()); 
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.add(new ACL("PUBLIC", Permission.READ));  
Storage storage = storageService.grantAccessOnDoc(dbName, collectionName, docId, aclSet);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.Add(new ACL("PUBLIC", Permission.READ));
App42Log.SetDebug(true);		//Print output in your editor console
storageService.GrantAccessOnDoc(dbName, collectionName, docId, aclSet, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
response ;  
var aclList = new Array();
var point1={
user:"PUBLIC",
permission:Permission.READ,
};
aclList.push(point1);
storageService.grantAccessOnDoc(dbName, collectionName,docId, aclList,{  
success: function(object) 
	{  
	var storage = JSON.parse(object);  
	response = storage.app42.response.storage;
	console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
});
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local aclList = {}
local acl  = ACL:new()
acl:setUser("PUBLIC")
acl:setPermission(Permission.READ)
aclList[1] = acl
local App42CallBack = {}
storageService:grantAccessOnDoc(dbName,collectionName,docId, aclList,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
HashSet<ACL> aclSet = new HashSet<ACL>();
aclSet.Add(new ACL("PUBLIC", Permission.READ));
Storage storage = storageService.GrantAccessOnDoc(dbName, collectionName, docId, aclSet);
Console.WriteLine("dbName is " + storage.GetDbName());		
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId = "docId";
$aclSet = array();
array_push($aclSet, new ACL("PUBLIC", Permission::READ));
$storage= $storageService->grantAccessOnDoc($dbName, $collectionName, $docId, $aclSet); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
Coming Soon
Coming Soon
Coming Soon
Coming Soon 

Update Document By Doc Id With Json Object

Update target document with JSONObject doc using the document id. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. docId - Id of the document to be updated for the target JSON doc jsonDoc - Complete json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";  
JSONObject newJsonObject = new JSONObject();
newJsonObject.put("Company", "Shephertz Technologies");
storageService.updateDocumentByDocId(dbName, collectionName, docId, newJsonObject, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
}); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";  
JObject newJsonObject = new JObject();
newJsonObject.Add("Company", "Shephertz Technologies");
storageService.UpdateDocumentByDocId(dbName, collectionName, docId, newJsonObject, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList()[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList()[i].GetUpdatedAt());
		} 
	}  
} 
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *docId = @"docId";
NSDictionary *dataDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Nick",@"name", nil];
Storage *storage = [storageService updateDocumentByDocId:dbName collectionName:collectionName docId:docId newDataDict:dataDict];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is %@ " , jsonDoc.docId);
	NSLog(@"jsonDoc is  %@ " , jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt   %@ " , jsonDoc.updatedAt);
	NSLog(@"CreatedAt   %@ " , jsonDoc.createdAt);
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";  
JSONObject newJsonObject = new JSONObject();
newJsonObject.put("Company", "Shephertz Technologies");
Storage storage = storageService.updateDocumentByDocId(dbName,collectionName,docId,newJsonObject);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";  
JSONObject newJsonObject = new JSONObject();
newJsonObject.put("Company", "Shephertz Technologies");
Storage storage = storageService.updateDocumentByDocId(dbName, collectionName, docId, newJsonObject);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId"; 
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("Company", "Shephertz Technologies");
App42Log.SetDebug(true);		//Print output in your editor console
storageService.UpdateDocumentByDocId(dbName, collectionName, docId, jsonDoc, 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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId";
var jsonDoc = new Object();
jsonDoc.name = "John";
jsonDoc.type = "20";
var response ;  
storageService.updateDocumentByDocId(dbName,collectionName,docId,jsonDoc,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
		console.log("objectId is " + response.jsonDoc._id.$oid)
		console.log("Created At is "+response.jsonDoc._$createdAt)
		console.log("Updated At is "+response.jsonDoc._$updatedAt)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local jsonDoc = {}
jsonDoc.name = "John"
jsonDoc.age = 20
local App42CallBack = {}
storageService:updateDocumentByDocId(dbName,collectionName,docId,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
		for i=1,table.getn(object:getJsonDocList()) do
			print("DocId is "..object:getJsonDocList()[i]:getDocId())
			print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->UpdateDocumentByKeyValue(dbName, collectionName, key, value, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("Company", "Shephertz Technologies");
Storage storage = storageService.UpdateDocumentByDocId(dbName,collectionName,docId,jsonDoc);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
	Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId= "docId";
$jsonDoc = new JSONObject();
$jsonDoc->put("Company","Shephertz Technologies");
$storage =$storageService->updateDocumentByDocId($dbName,$collectionName,$docId,$jsonDoc);  
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->UpdateDocumentByKeyValue(dbName, collectionName, key, value, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon 
App42Log.setDebug(true);
var dbName:String  = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>";   
var docId:String = "docId";  
var newjsonObject:Object = new Object;
newjsonObject.key  = "<Enter_the_value>";
storageService.updateDocumentByDocIdWithJsonObject(dbName, collectionName, docId, newjsonObject,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("dbName is " + storage.getDbName());
		trace("Collection Name is :  " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}
Not Available

Save Or Update Document By Key Value With JSON String

Update target document using a key value search parameter. This key value pair will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Note:If no document is search with this key value pair then new document is insert.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. key - Key to be searched for the target JSON doc. value - Value to be searched for the target JSON doc. jsonDoc - Complete Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.saveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList()[i].GetUpdatedAt());
		} 
	}  
} 
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *key = @"Company";
NSString *value = @"Shephertz";
NSDictionary *jsonDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Shephertz Technologies",key, nil];
NSString *jsonDoc = [jsonDict JSONRepresentation];
Storage *storage = [storageService saveOrUpdateDocumentByKeyValue:dbName collectionName:collectionName key:key value:value jsonDoc:jsonDoc];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is %@ " , jsonDoc.docId);
	NSLog(@"jsonDoc is  %@ " , jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt   %@ " , jsonDoc.updatedAt);
	NSLog(@"CreatedAt   %@ " , jsonDoc.createdAt);
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.saveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc);   
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}       
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.saveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "name",
value = "Nick",
response ; 
var jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.saveOrUpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log("dbName is :" +storageObj.app42.response.storage.dbName)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local jsonDoc = "{\"Company\":\"Shephertz Technologies\"}"
local App42CallBack = {}
storageService:saveOrupdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		print("UpdatedAt is "..object:getJsonDocList()[i]:getUpdatedAt())
		print("jsonDoc is "..JSON:encode(object:getJsonDocList()[i]:getJsonDoc())); 
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc);   
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAt is " + jsonDocList[i].GetUpdatedAt());  
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key = "name"; 
$value = "Nick"; 
$jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
$storage = $storageService->saveOrUpdateDocumentByKeyValue($dbName, $collectionName, $key, $value, $jsonDoc);
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}	
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String  = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key:String = "<Enter_the_key>"; 
var value:String = "<Enter_the_value>"; 
var jsonDoc:String = "{\"Company\":\"Shephertz Technologies\"}";
storageService.saveOrupdateDocumentByKeyValue(dbName,collectionName,key,value ,jsonDoc ,new callback());	
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("dbName is " + storage.getDbName());
		trace("Collection Name is :  " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}
Coming Soon 

Save Or Update Document By Key Value With JSON Object

Update target document using a key value search parameter. This key value pair will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Note:If no document is search with this key value pair then new document is insert.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. key - Key to be searched for the target JSON doc. value - Value to be searched for the target JSON doc. jsonDoc - Complete Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
storageService.saveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JObject jsonDoc = new JObject();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
storageService.SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList()[i].GetUpdatedAt());
		} 
	}  
} 
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *key = @"name";
NSString *value = @"Nick";
NSDictionary *jsonDict = [NSDictionary dictionaryWithObjectsAndKeys:@"John ",key, nil];
Storage *storage = [storageService saveOrUpdateDocumentByKeyValue:dbName collectionName:collectionName key:key value:value dataDict:jsonDict];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is %@ " , jsonDoc.docId);
	NSLog(@"jsonDoc is  %@ " , jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt   %@ " , jsonDoc.updatedAt);
	NSLog(@"CreatedAt   %@ " , jsonDoc.createdAt);
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
Storage storage = storageService.saveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}             
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
Storage storage = storageService.saveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42Log.SetDebug(true);		//Print output in your editor console
storageService.SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "name",
value = "Nick",
response ; 
var jsonDoc = new Object();
jsonDoc.name = "John";
jsonDoc.type = "20";
storageService.saveOrUpdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log("dbName is :" +storageObj.app42.response.storage.dbName)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local jsonDoc = {}
jsonDoc.name = "John"
jsonDoc.age = 20
local App42CallBack = {}
storageService:saveOrupdateDocumentByKeyValue(dbName,collectionName,key,value,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		print("UpdatedAt is "..object:getJsonDocList()[i]:getUpdatedAt())
		print("jsonDoc is "..JSON:encode(object:getJsonDocList()[i]:getJsonDoc())); 
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
Storage storage = storageService.SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, jsonDoc);   
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAt is " + jsonDocList[i].GetUpdatedAt());  
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key = "name"; 
$value = "Nick"; 
$jsonDoc  = new JSONObject();
$jsonDoc->put("name", "John");
$jsonDoc->put("age", 20);
$storage = $storageService->saveOrUpdateDocumentByKeyValue($dbName, $collectionName, $key, $value, $jsonDoc);
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key = "name";
const char* value = "Nick";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->SaveOrUpdateDocumentByKeyValue(dbName, collectionName, key, value, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String  = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key:String = "<Enter_the_key>"; 
var value:String = "<Enter_the_value>"; 
var jsonDoc:Object  = new Object();
jsonDoc.name = "John"; 
jsonDoc.age = 20; 
storageService.saveOrupdateDocumentByKeyValueWithJsonObject(dbName,collectionName,key,value ,jsonDoc ,new callback());	
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("dbName is " + storage.getDbName());
		trace("Collection Name is :  " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}
Coming Soon 

Update Document By Query With JSON String

Update target documents using a Custom Query. This Custom Query will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. query - Query Object containing custom query for searching docs. jsonDoc - Complete Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.updateDocumentByQuery(dbName, collectionName, query, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	System.out.println("Record Count is "+ storage.getRecordCount());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";     
String value = "Nick";       
String key2 = "age";     
int value1 = 30;   
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.UpdateDocumentByQuery(dbName, collectionName, query, jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList()[i].GetUpdatedAt());
		} 
	}  
}
Not Available
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.updateDocumentByQuery(dbName, collectionName, query, jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
System.out.println("Record Count is "+ storage.getRecordCount());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}       
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.updateDocumentByQuery(dbName, collectionName, query, jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
System.out.println("Record Count is "+ storage.getRecordCount());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";     
String value = "Nick";       
String key2 = "age";     
int value1 = 30;   
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.    
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.UpdateDocumentByQuery(dbName, collectionName, query, jsonDoc, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		App42Log.Console("Record Count is "+ storage.GetRecordCount());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key1 = "name",  
value1 = "Nick",   
key2 = "age",
value2 = 30,
response ; 
var queryBuilder = new QueryBuilder();
var q1= queryBuilder.build(key1, value1, Operator.EQUALS);    
var q2 = queryBuilder.build(key2, value2, Operator.GREATER_THAN);		
var query = queryBuilder.compoundOperator(q1,Operator.OR, q2);   
var jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService.updateDocumentByQuery(dbName, collectionName,query,jsonDoc,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log("dbName is :" +storageObj.app42.response.storage.dbName)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local jsonDoc = "{\"Company\":\"Shephertz Technologies\"}"
local key1 = "name"
local value1 = "Nick"
local key2 = "age"
local value2 = 30
local q1 = queryBuilder:build(key1, value1, Operator.EQUALS)   
local q2 = queryBuilder:build(key2, value2, Operator.GREATER_THAN)		
local query = queryBuilder:compoundOperator(q1,Operator.OR, q2)
local App42CallBack = {}
storageService:updateDocumentByQuery(dbName, collectionName,query,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		print("UpdatedAt is "..object:getJsonDocList()[i]:getUpdatedAt())
		print("jsonDoc is "..JSON:encode(object:getJsonDocList()[i]:getJsonDoc())); 
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->UpdateDocumentByQuery(dbName, collectionName, query3, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";     
String value = "Nick";       
String key2 = "age";     
int value1 = 30;   
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.    
String jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
Storage storage = storageService.UpdateDocumentByQuery(dbName,collectionName,query,jsonDoc);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
Console.WriteLine("Record Count is "+ storage.GetRecordCount());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key1 = "name";     
$value = "Nick";       
$key2 = "age";     
$value1 = 30; 
$queryBuilder = new QueryBuilder(); 
$q1 = queryBuilder->build($key1, $value2, Operator::EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 =  queryBuilder->build($key2, $value2, Operator::GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);       
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
$jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
$storage = $storageService->updateDocumentByQuery($dbName,$collectionName, $query, $jsonDoc);
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
const char* jsonDoc = "{\"Company\":\"Shephertz Technologies\"}";
storageService->UpdateDocumentByQuery(dbName, collectionName, query3, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String  = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key1:String = "name";  
var value1:String = "Nick";  
var key2:String = "age";  
var value2:int = 30;  
var q1:Query = QueryBuilder.build(key1, value1, Operator.EQUALS);  
var q2:Query = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);  
var query:Query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);  
var jsonDoc:String = "{\"Company\":\"Shephertz Technologies\"}";
storageService.updateDocumentByQuery(dbName, collectionName, query ,jsonDoc ,new callback());	
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("dbName is " + storage.getDbName());
		trace("Collection Name is :  " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}
Coming Soon 

Update Document By Query With JSON Object

Update target documents using a Custom Query. This Custom Query will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. query - Query Object containing custom query for searching docs. jsonDoc - Complete Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.    
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
storageService.updateDocumentByQuery(dbName, collectionName, query, jsonDoc, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";     
String value = "Nick";       
String key2 = "age";     
int value1 = 30;   
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
JObject jsonDoc = new JObject();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
storageService.UpdateDocumentByQuery(dbName, collectionName, query, jsonDoc, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		Console.WriteLine("dbName is " + storage.GetDbName());
		Console.WriteLine("collection Name is " + storage.GetCollectionName());
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0; i<jsonDocList.Count; i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList()[i].GetUpdatedAt());
		} 
	}  
} 
Not Available
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
Storage storage = storageService.updateDocumentByQuery(dbName,collectionName,query,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
System.out.println("Record Count is "+ storage.getRecordCount());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}       
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20);
Storage storage = storageService.updateDocumentByQuery(dbName,collectionName,query,jsonDoc);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}    
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";     
String value = "Nick";       
String key2 = "age";     
int value1 = 30;   
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42Log.SetDebug(true);		//Print output in your editor console
storageService.UpdateDocumentByQuery(dbName, collectionName, query, jsonDoc, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		App42Log.Console("Record Count is "+ storage.GetRecordCount());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key1 = "name",  
value1 = "Nick",   
key2 = "age",
value2 = 30,
response ; 
var queryBuilder = new QueryBuilder();
var q1= queryBuilder.build(key1, value1, Operator.EQUALS);    
var q2 = queryBuilder.build(key2, value2, Operator.GREATER_THAN);		
var query = queryBuilder.compoundOperator(q1,Operator.OR, q2);   
var jsonDoc = new Object();
jsonDoc.name = "Nick";
jsonDoc.type = "30";
var response ;
storageService.updateDocumentByQuery(dbName, collectionName,query,jsonDoc,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log("dbName is :" +storageObj.app42.response.storage.dbName)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
			console.log(response._$createdAt)
			console.log(response._$updatedAt)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local jsonDoc = {}
jsonDoc.name = "John"
jsonDoc.age = 20
local key1 = "name"
local value1 = "Nick"
local key2 = "age"
local value2 = 30
local q1 = queryBuilder:build(key1, value1, Operator.EQUALS)   
local q2 = queryBuilder:build(key2, value2, Operator.GREATER_THAN)		
local query = queryBuilder:compoundOperator(q1,Operator.OR, q2)
local App42CallBack = {}
storageService:updateDocumentByQuery(dbName, collectionName,query,jsonDoc,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
		print("UpdatedAt is "..object:getJsonDocList()[i]:getUpdatedAt())
		print("jsonDoc is "..JSON:encode(object:getJsonDocList()[i]:getJsonDoc())); 
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->UpdateDocumentByQuery(dbName, collectionName, query3, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key1 = "name";     
String value = "Nick";       
String key2 = "age";     
int value1 = 30;   
Query q1 = QueryBuilder.Build(key1, value2, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
Dictionary<String, Object> jsonDoc = new Dictionary<String, Object>();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
Storage storage = storageService.UpdateDocumentByQuery(dbName,collectionName,query,jsonDoc);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
Console.WriteLine("Record Count is "+ storage.GetRecordCount());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key1 = "name";     
$value = "Nick";       
$key2 = "age";     
$value1 = 30; 
$queryBuilder = new QueryBuilder(); 
$q1 = queryBuilder->build($key1, $value2, Operator::EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 =  queryBuilder->build($key2, $value2, Operator::GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);       
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
$jsonDoc = new JSONObject();
$jsonDoc->put("name","John");
$jsonDoc->put("age",20);
$storage = $storageService->updateDocumentByQuery($dbName,$collectionName, $query, $jsonDoc);
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* key1 = "name";
const char* value1 = "Nick";
const char* key2 = "age";
const char* value2 = "30";
Query *query1 = QueryBuilder::BuildQuery(key1, value1, APP42_OP_EQUALS);
Query *query2 = QueryBuilder::BuildQuery(key2, value2, APP42_OP_GREATER_THAN_EQUALTO);
Query *query3 = QueryBuilder::CompoundOperator(query1, APP42_OP_OR, query2);
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->UpdateDocumentByQuery(dbName, collectionName, query3, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Not Available
var dbName:String  = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key1:String = "name";  
var value1:String = "Nick";  
var key2:String = "age";  
var value2:int = 30;  
var q1:Query = QueryBuilder.build(key1, value1, Operator.EQUALS);  
var q2:Query = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);  
var query:Query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);  
var jsonDoc:Object  = new Object();
jsonDoc.name = "John"; 
jsonDoc.age = 20; 
storageService.updateDocumentByQuery(dbName, collectionName, query ,jsonDoc ,new callback());	
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("dbName is " + storage.getDbName());
		trace("Collection Name is :  " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}
Coming Soon 

Add Or Update Keys With JSON String

This function will allow user’s to add or update the json document keys based on object id of json document. Using this method, you can add new keys or update the exisitng keys in current document. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter"}” and your new json document is: “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Also, if you want to add a new key in existing document you can easily do by using this method. For example: You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter and firstName is John. In this case you need to pass the json document with value like “{"name":"John Carter","firstName":"John"}” and your new json document is: “{"name":"John Carter","firstName":"John","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON keys needs to be updated. docId - Id of the document to be updated for the target JSON doc. keys - Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.addOrUpdateKeys(dbName, collectionName, docId, keys, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());		
}
}); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.AddOrUpdateKeys(dbName,collectionName,docId,keys, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}
Not Available
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage storage = storageService.addOrUpdateKeys(dbName, collectionName, docId, keys);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
System.out.println("Record Count is "+ storage.getRecordCount());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}            
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage storage = storageService.addOrUpdateKeys(dbName,collectionName,docId,keys);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
App42Log.SetDebug(true);		//Print output in your editor console
storageService.AddOrUpdateKeys(dbName, collectionName, docId, keys, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
response ;  
var keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.addOrUpdateKeys(dbName, collectionName,docId, keys,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
		console.log("objectId is " + response.jsonDoc._id.$oid)
		console.log("Created At is "+response.jsonDoc._$createdAt)
		console.log("Updated At is "+response.jsonDoc._$updatedAt)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}"
local App42CallBack = {}
storageService:addOrUpdateKeys(dbName, collectionName,docId, keys,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("collectionName is "..object:getCollectionName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("Created At is "..object:getJsonDocList():getCreatedAt())
	print("Updated At is "..object:getJsonDocList():getUpdatedAt())
	print("getJsonDoc is : "..JSON:encode(object:getJsonDocList():getJsonDoc()) )  
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
const char* jsonDoc = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService->AddOrUpdateKeys(dbName, collectionName, docId, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted)); 

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
String keys = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Storage storage = storageService.AddOrUpdateKeys(dbName, collectionName, docId, keys);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
Console.WriteLine("Record Count is "+ storage.GetRecordCount());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$key1 = "name";     
$value = "Nick";       
$key2 = "age";     
$value1 = 30; 
$queryBuilder = new QueryBuilder(); 
$q1 = queryBuilder->build($key1, $value2, Operator::EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 =  queryBuilder->build($key2, $value2, Operator::GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);       
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
$jsonDoc = new JSONObject();
$jsonDoc->put("name","John");
$jsonDoc->put("age",20);
$storage = $storageService->updateDocumentByQuery($dbName,$collectionName, $query, $jsonDoc);
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
} 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
const char* jsonDoc = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService->AddOrUpdateKeys(dbName, collectionName, docId, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted)); 

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var docId:String = "docId";
var keys:String = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
storageService.addOrUpdateKeys(dbName,collectionName, docId, keys, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
} 
Coming Soon 

Add Or Update Keys With JSON Object

This function will allow user’s to add or update the json document keys based on object id of json document. Using this method, you can add new keys or update the exisitng keys in current document. For example :- You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter. In this case you need to pass the json document with updated value like “{"name":"John Carter"}” and your new json document is: “{"name":"John Carter","Company":"Shephertz Technologies"}”.

Also, if you want to add a new key in existing document you can easily do by using this method. For example: You have an existing json document like : “{"name":"Nick Carter","Company":"Shephertz Technologies"}” and you need to update this json document with name is John Carter and firstName is John. In this case you need to pass the json document with value like “{"name":"John Carter","firstName":"John"}” and your new json document is: “{"name":"John Carter","firstName":"John","Company":"Shephertz Technologies"}”.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON keys needs to be updated. docId - Id of the document to be updated for the target JSON doc. keys - Json document with updated values.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
JSONObject keys = new JSONObject();
keys.put("name","John");
keys.put("age",20);
storageService.addOrUpdateKeys(dbName, collectionName, docId, keys, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());		
}
});
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
JObject keys = new JObject();
keys.Add("name","Nick");
keys.Add("age",30);
storageService.AddOrUpdateKeys(dbName,collectionName,docId,keys, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *docId = @"docId";
NSDictionary *jsonDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Nick",@"name", nil];
Storage *storage = [storageService addOrUpdateKeys:dbName collectionName:collectionName docId:docId dataDict:jsonDict];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is %@ ",jsonDoc.docId);
	NSLog(@"jsonDoc is  %@ ",jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt   %@",jsonDoc.updatedAt);
	NSLog(@"CreatedAt   %@",jsonDoc.createdAt);
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
JSONObject keys = new JSONObject();
keys.put("name","John");
keys.put("age",20);
Storage storage = storageService.addOrUpdateKeys(dbName, collectionName, docId, keys);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}           
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
JSONObject keys = new JSONObject();
keys.put("name","John");
keys.put("age",20);
Storage storage = storageService.addOrUpdateKeys(dbName,collectionName,docId,keys);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Dictionary<string,object> keys = new Dictionary<string,object>();
keys.Add("name","Nick");
keys.Add("age",30);
App42Log.SetDebug(true);		//Print output in your editor console
storageService.AddOrUpdateKeys(dbName, collectionName, docId, keys, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "docId",
response ;  
var keys = new Object();
keys.name = "Nick";
keys.type = "30";
storageService.addOrUpdateKeys(dbName, collectionName,docId, keys,{  
success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
		console.log("objectId is " + response.jsonDoc._id.$oid)
		console.log("Created At is "+response.jsonDoc._$createdAt)
		console.log("Updated At is "+response.jsonDoc._$updatedAt)
	},  
	error: function(error) {  
	}  
});  
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "docId"
local keys = {}
keys.name = "Nick"
keys.age = 30
local App42CallBack = {}
storageService:addOrUpdateKeys(dbName, collectionName,docId, keys,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("collectionName is "..object:getCollectionName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("Created At is "..object:getJsonDocList():getCreatedAt())
	print("Updated At is "..object:getJsonDocList():getUpdatedAt())
	print("GetJsonDoc is : "..JSON:encode(object:getJsonDocList():getJsonDoc()) )  
	
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->AddOrUpdateKeys(dbName, collectionName, docId, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
Dictionary<string,object> keys = new Dictionary<string,object>();
keys.Add("name","Nick");
keys.Add("age",30);
Storage storage = storageService.AddOrUpdateKeys(dbName, collectionName, docId, keys);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
Console.WriteLine("Record Count is "+ storage.GetRecordCount());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId = "docId";
$keys = new JSONObject();
$keys->put("name","Nick");
$keys->put("age",30);
$storage= $storageService->addOrUpdateKeys($dbName, $collectionName, $docId, $keys);
print_r("Db Name is :".$storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storageObj->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
const char* docId = "docId";
App42Object *object = new App42Object();
object->setObject("name", "John");
object->setObject("age", "20");
storageService->AddOrUpdateKeys(dbName, collectionName, docId, object, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var docId:String = "docId";
var keys:Object  = new Object();
keys.name = "Nick"; 
keys.age = 30; 
storageService.addOrUpdateKeys(dbName,collectionName, docId, keys, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
} 
Coming Soon 

Add Attachment To Docs

Attach file object in your JSON document.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. docId - Id of the document to be updated for the target JSON doc. file - InputStream of the file to be uploaded.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
storageService.addAttachmentToDocs(dbName, collectionName, docId, file, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc()); 
		for (int j = 0; j < jsonDocList.get(i).getFileList().size(); j++) {
			System.out.println("Get File Id :"+jsonDocList.get(i).getFileList().get(j).getFileId());
			System.out.println("Url of image : "+jsonDocList.get(i).getFileList().get(j).getUrl());
			System.out.println("File Name :"+jsonDocList.get(i).getFileList().get(j).getName());
			System.out.println("File Type :"+jsonDocList.get(i).getFileList().get(j).getType());
		}
	}	
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());		
}
});
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
String docId = "docId";
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
storageService.AddAttachmentToDocs(dbName, collectionName, docId, file, Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
			for (int j = 0; j < jsonDocList[i].GetFileList().Count(); j++) 
			{
				Console.WriteLine("Get File Id :"+jsonDocList[i].GetFileList()[j].GetFileId());
				Console.WriteLine("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
				Console.WriteLine("File Name :"+jsonDocList[i].GetFileList()[j].GetName());
				Console.WriteLine("File Type :"+jsonDocList[i].GetFileList()[j].GetType());
			}
		}  
	}  
}
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *docId = @"docId";
NSData *imageFileData = nil; /* Get file data from your source */
App42File *file = [[App42File alloc] initWithFileData:imageFileData fileName:@"sample.png" andType:IMAGE];
Storage *storage = [storageService addAttachmentToDocs:dbName collectionName:collectionName docId:docId attachment:file];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is = %@ ", jsonDoc.docId);
	NSLog(@"jsonDoc is = %@ ", jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt = %@ ", jsonDoc.updatedAt);
	NSLog(@"CreatedAt = %@ ", jsonDoc.createdAt);
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
Storage storage = storageService.addAttachmentToDocs(dbName, collectionName, docId, file);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
	for (int j = 0; j < jsonDoc.getFileList().size(); j++) 
	{
		App42File fileList = (App42File)jsonDoc.getFileList().elementAt(j);
		System.out.println("Get File Id :" + fileList.getFileId());
		System.out.println("Url of image : " + fileList.getUrl());
		System.out.println("File Name :" + fileList.getName());
		System.out.println("File Type :" + fileList.getType());
	}
}        
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "docId";
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
Storage storage = storageService.addAttachmentToDocs(dbName, collectionName, docId, file);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc()); 
	for (int j = 0; j < jsonDocList.get(i).getFileList().size(); j++) 
	{
		System.out.println("Get File Id :"+jsonDocList.get(i).getFileList().get(j).getFileId());
		System.out.println("Url of image : "+jsonDocList.get(i).getFileList().get(j).getUrl());
		System.out.println("File Name :"+jsonDocList.get(i).getFileList().get(j).getName());
		System.out.println("File Type :"+jsonDocList.get(i).getFileList().get(j).getType());
	}
}	
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
String docId = "docId";
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
App42Log.SetDebug(true);		//Print output in your editor console
storageService.AddAttachmentToDocs(dbName, collectionName, docId, file, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
			
			for (int j = 0; j < jsonDocList[i].GetFileList().Count; j++) 
			{
				App42Log.Console("Get File Id : "+jsonDocList[i].GetFileList()[j].GetFileId());
				App42Log.Console("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
				App42Log.Console("File Name : "+jsonDocList[i].GetFileList()[j].GetName());
				App42Log.Console("File Type : "+jsonDocList[i].GetFileList()[j].GetType());
			}
		}  
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Coming Soon 
Not Available
Coming Soon 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
String docId = "docId";
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
Storage storage = storageService.AddAttachmentToDocs(dbName, collectionName, docId, file);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
	for (int j = 0; j < jsonDocList[i].GetFileList().Count(); j++) 
	{
		Console.WriteLine("Get File Id :"+jsonDocList[i].GetFileList()[j].GetFileId());
		Console.WriteLine("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
		Console.WriteLine("File Name :"+jsonDocList[i].GetFileList()[j].GetName());
		Console.WriteLine("File Type :"+jsonDocList[i].GetFileList()[j].GetType());
	}
}   
Coming Soon 
Coming Soon
Coming Soon
Not Available
Coming Soon 

Insert JSON With File

Attach file object with insert json doc.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. json - Target JSON document to be saved. file - InputStream of the file to be uploaded.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
storageService.insertJSONDocument(dbName, collectionName, json,file ,new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc()); 
		for (int j = 0; j < jsonDocList.get(i).getFileList().size(); j++) 
		{
			System.out.println("Get File Id :"+jsonDocList.get(i).getFileList().get(j).getFileId());
			System.out.println("Url of image : "+jsonDocList.get(i).getFileList().get(j).getUrl());
			System.out.println("File Name :"+jsonDocList.get(i).getFileList().get(j).getName());
			System.out.println("File Type :"+jsonDocList.get(i).getFileList().get(j).getType());
		}
	}	
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
storageService.InsertJSONDocument(dbName,collectionName,json,file, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
			for (int j = 0; j < jsonDocList[i].GetFileList().Count(); j++) 
			{
				Console.WriteLine("Get File Id :"+jsonDocList[i].GetFileList()[j].GetFileId());
				Console.WriteLine("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
				Console.WriteLine("File Name :"+jsonDocList[i].GetFileList()[j].GetName());
				Console.WriteLine("File Type :"+jsonDocList[i].GetFileList()[j].GetType());
			}
		}  
	}  
}
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSDictionary *jsonDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Nick",@"name", nil];
NSData *imageFileData = nil; /* Get file data from your source */
App42File *file = [[App42File alloc] initWithFileData:imageFileData fileName:@"sample.png" andType:IMAGE];
Storage *storage = [storageService insertJSONDocument:dbName collectionName:collectionName json:[jsonDict JSONRepresentation] attachment:file];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is = %@ ", jsonDoc.docId);
	NSLog(@"jsonDoc is = %@ ", jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt = %@ ", jsonDoc.updatedAt);
	NSLog(@"CreatedAt = %@ ", jsonDoc.createdAt);
	for(App42File *file in jsonDoc.fileList)
	{
		NSLog(@"name is = %@ ", file.name);
		NSLog(@"url = %@ ", file.url);
		NSLog(@"type = %@ ", file.type);
	}
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
Storage storage = storageService.insertJSONDocument(dbName, collectionName, json, file);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
	for (int j = 0; j < jsonDoc.getFileList().size(); j++) 
	{
		App42File fileList = (App42File)jsonDoc.getFileList().elementAt(j);
		System.out.println("Get File Id :" + fileList.getFileId());
		System.out.println("Url of image : " + fileList.getUrl());
		System.out.println("File Name :" + fileList.getName());
		System.out.println("File Type :" + fileList.getType());
	}
}          
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
Storage storage = storageService.insertJSONDocument(dbName, collectionName, json,file);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc()); 
	for (int j = 0; j < jsonDocList.get(i).getFileList().size(); j++) 
	{
		System.out.println("Get File Id :"+jsonDocList.get(i).getFileList().get(j).getFileId());
		System.out.println("Url of image : "+jsonDocList.get(i).getFileList().get(j).getUrl());
		System.out.println("File Name :"+jsonDocList.get(i).getFileList().get(j).getName());
		System.out.println("File Type :"+jsonDocList.get(i).getFileList().get(j).getType());
	}
}	
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
App42Log.SetDebug(true);		//Print output in your editor console
storageService.InsertJSONDocument(dbName, collectionName, json, file, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
			
			for (int j = 0; j < jsonDocList[i].GetFileList().Count; j++) 
			{
				App42Log.Console("Get File Id : "+jsonDocList[i].GetFileList()[j].GetFileId());
				App42Log.Console("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
				App42Log.Console("File Name : "+jsonDocList[i].GetFileList()[j].GetName());
				App42Log.Console("File Type : "+jsonDocList[i].GetFileList()[j].GetType());
			}
		}  
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Coming Soon 
Not Available 
Coming Soon 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
Storage storage = storageService.InsertJSONDocument(dbName, collectionName, json, file);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
	for (int j = 0; j < jsonDocList[i].GetFileList().Count(); j++) 
	{
		Console.WriteLine("Get File Id :"+jsonDocList[i].GetFileList()[j].GetFileId());
		Console.WriteLine("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
		Console.WriteLine("File Name :"+jsonDocList[i].GetFileList()[j].GetName());
		Console.WriteLine("File Type :"+jsonDocList[i].GetFileList()[j].GetType());
	}
}   
Coming Soon 
Coming Soon
Coming Soon
Not Available
Coming Soon 

Insert JSON With File Using JSONObject

Attach file object with insert json doc.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be updated. json - Target JSON document to be saved. file - InputStream of the file to be uploaded.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONObject json = new JSONObject();
json.put("name","Nick");
json.put("age",30);
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
storageService.insertJSONDocument(dbName, collectionName, json,file ,new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc()); 
		for (int j = 0; j < jsonDocList.get(i).getFileList().size(); j++) 
		{
			System.out.println("Get File Id :"+jsonDocList.get(i).getFileList().get(j).getFileId());
			System.out.println("Url of image : "+jsonDocList.get(i).getFileList().get(j).getUrl());
			System.out.println("File Name :"+jsonDocList.get(i).getFileList().get(j).getName());
			System.out.println("File Type :"+jsonDocList.get(i).getFileList().get(j).getType());
		}
	}	
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JObject json = new JObject();
json.Add("name","Nick");
json.Add("age",30);
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
storageService.InsertJSONDocument(dbName,collectionName,json,file, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
			for (int j = 0; j < jsonDocList[i].GetFileList().Count(); j++) 
			{
				Console.WriteLine("Get File Id :"+jsonDocList[i].GetFileList()[j].GetFileId());
				Console.WriteLine("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
				Console.WriteLine("File Name :"+jsonDocList[i].GetFileList()[j].GetName());
				Console.WriteLine("File Type :"+jsonDocList[i].GetFileList()[j].GetType());
			}
		}  
	}  
}
Not Availabe
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
JSONObject json = new JSONObject();
json.put("name","Nick");
json.put("age",30);
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
Storage storage = storageService.insertJSONDocument(dbName, collectionName, json, file);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
	for (int j = 0; j < jsonDoc.getFileList().size(); j++) 
	{
		App42File fileList = (App42File)jsonDoc.getFileList().elementAt(j);
		System.out.println("Get File Id :" + fileList.getFileId());
		System.out.println("Url of image : " + fileList.getUrl());
		System.out.println("File Name :" + fileList.getName());
		System.out.println("File Type :" + fileList.getType());
	}
}          
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
JSONObject json = new JSONObject();
json.put("name","Nick");
json.put("age",30);
InputStream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.setFileInputStream(inputStream);
file.setFileType(UploadFileType.IMAGE);
file.setName("sample.jpg");
Storage storage = storageService.insertJSONDocument(dbName, collectionName, json,file);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc()); 
	for (int j = 0; j < jsonDocList.get(i).getFileList().size(); j++) 
	{
		System.out.println("Get File Id :"+jsonDocList.get(i).getFileList().get(j).getFileId());
		System.out.println("Url of image : "+jsonDocList.get(i).getFileList().get(j).getUrl());
		System.out.println("File Name :"+jsonDocList.get(i).getFileList().get(j).getName());
		System.out.println("File Type :"+jsonDocList.get(i).getFileList().get(j).getType());
	}
}	
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Dictionary<string,object> json = new Dictionary<string,object>();
json.Add("name","Nick");
json.Add("age",30);
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
App42Log.SetDebug(true);		//Print output in your editor console 
storageService.InsertJSONDocument(dbName, collectionName, json, file, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Storage storage = (Storage) response; 
		App42Log.Console("dbName is " + storage.GetDbName());
		App42Log.Console("collection Name is " + storage.GetCollectionName());
		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());
			App42Log.Console("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			App42Log.Console("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
			
			for (int j = 0; j < jsonDocList[i].GetFileList().Count; j++) 
			{
				App42Log.Console("Get File Id : "+jsonDocList[i].GetFileList()[j].GetFileId());
				App42Log.Console("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
				App42Log.Console("File Name : "+jsonDocList[i].GetFileList()[j].GetName());
				App42Log.Console("File Type : "+jsonDocList[i].GetFileList()[j].GetType());
			}
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Coming Soon 
Not Available 
Coming Soon 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Dictionary<string,object> json = new Dictionary<string,object>();
json.Add("name","Nick");
json.Add("age",30);
Stream inputStream = null; /* Get input stream from your source */
App42File file = new App42File();
file.SetFileInputStream(inputStream);
file.SetFileType("image");
file.SetName("sample.jpg");
Storage storage = storageService.InsertJSONDocument(dbName, collectionName, json, file);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collection Name is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
	Console.WriteLine("CreatedAt is " + jsonDocList[i].GetCreatedAt());  
	Console.WriteLine("UpdatedAtis " + jsonDocList[i].GetUpdatedAt());  
	for (int j = 0; j < jsonDocList[i].GetFileList().Count(); j++) 
	{
		Console.WriteLine("Get File Id :"+jsonDocList[i].GetFileList()[j].GetFileId());
		Console.WriteLine("Url of image : "+jsonDocList[i].GetFileList()[j].GetUrl());
		Console.WriteLine("File Name :"+jsonDocList[i].GetFileList()[j].GetName());
		Console.WriteLine("File Type :"+jsonDocList[i].GetFileList()[j].GetType());
	}
}  
Coming Soon 
Coming Soon
Coming Soon
Not Available
Coming Soon 

Insert JSON With GeoTag

Save the JSON document with geo location in giving database name and collection name.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc has to be saved. json - Target JSON document to be saved.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag gp = new GeoTag();
gp.setLat(new BigDecimal(-73.99171));
gp.setLng(new BigDecimal(40.738868));
storageService.setGeoTag(gp);
storageService.insertJSONDocument(dbName, collectionName, json,new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();          
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	}  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
storageService.SetGeoTag(gp);
storageService.InsertJSONDocument(dbName,collectionName,json, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSString *json = @"{\"name\":\"Nick\",\"age\":40,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag *geoTag = [[GeoTag alloc] initWithLatitude:2.0 andLongitude:20.0];
storageServiceObject.geoTag = [geoTag toString];
Storage *storage = [storageServiceObject insertJSONDocument:dbName collectionName:collectionName json:json];

NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" ,  storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
    NSLog(@"objectId is = %@ ", jsonDoc.docId);
    NSLog(@"jsonDoc is  = %@ ", jsonDoc.jsonDoc);
    NSLog(@"UpdatedAt   = %@ ", jsonDoc.updatedAt);
    NSLog(@"CreatedAt   = %@ ", jsonDoc.createdAt);
}

String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag gp = new GeoTag();
gp.setLat(new Double(-74.2713));  
gp.setLng(new Double(40.73137));  
storageService.setGeoTag(gp);
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("Collection Name is " + storage.getCollectionName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag gp = new GeoTag();
gp.setLat(new BigDecimal(-73.99171));
gp.setLng(new BigDecimal(40.738868));
storageService.setGeoTag(gp);
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();          
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
storageService.SetGeoTag(gp);
App42Log.SetDebug(true);		//Print output in your editor console
storageService.InsertJSONDocument(dbName, collectionName, json, 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());
		}  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
var gp = new GeoTag();
gp.setLat(-73.1234)
gp.setLng(-26.1234)
storageService.setGeoTag(gp);
var response ;  
storageService.insertJSONDocument(dbName, collectionName, json,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
		console.log("objectId is " + response.jsonDoc._id.$oid)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}"
local gp = require("App42-Lua-API.GeoTag")
gp:setLat(-73.99171)
gp:setLng(40.738868)
storageService:setGeoTag(gp);
local App42CallBack = {}
storageService:insertJSONDocument(dbName, collectionName, json,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	print("collectionName is "..object:getCollectionName())
	print("DocId is "..object:getJsonDocList():getDocId())
	print("Created At is "..object:getJsonDocList():getCreatedAt())
	print("Updated At is "..object:getJsonDocList():getUpdatedAt())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
GeoTag gp = new GeoTag();
gp.SetLat(-73.99171);
gp.SetLng(40.738868);
storageService.SetGeoTag(gp);
Storage storage = storageService.InsertJSONDocument(dbName,collectionName,json);  
Console.WriteLine("dbName is " + storage.GetDbName());
Console.WriteLine("collectionName is " + storage.GetCollectionName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
$gp = new GeoTag();
$gp->setLat(-73.99171);
$gp->setLng(40.738868);
$storageService->setGeoTag($gp);
$storage = $storageService->insertJSONDocument($dbName, $collectionName, $json); 
print_r("dbName is " . $storage->getDbName());
print_r("collectionName is " . $storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
Coming Soon
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var json:String = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
var gp:GeoTag = new GeoTag();
gp.setLat(-73.99171);
gp.setLng(40.738868);
storageService.setGeoTag(gp);
storageService.insertJSONDocument(dbName,collectionName,json, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDocsList:Array = storage.getJsonDocList();
		for(var i:int=0; i < jsonDocsList.length;i++)
		{
			jsonDoc = JSONDocument(jsonDocsList[i]);
			trace("Docid is : " + jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());
			if(jsonDoc.getLocation()!=null)
			{
				trace("Lat is : " + jsonDoc.getLocation().getLat());
				trace("Lng is : " + jsonDoc.getLocation().getLng());
			}
		}
	}  
}  
Coming Soon 

Sorting Of JSON Documents

Find documents in sorted form according to given key stored in the database and collection by using key value search parameter.Note Same can be done in all find methods.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc needs to be searched. key - Key to be searched for the target JSON doc. value - Value to be searched for the target JSON doc.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("orderByDescending", "<Name_Of_key_You_Want_To_Sort>");// Use orderByDescending for Descending or orderByAscending for Ascending
storageService.setOtherMetaHeaders(otherMetaHeaders);
storageService.findDocumentByKeyValue(dbName, collectionName, key, value, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("orderByAscending", "<Name_Of_key_You_Want_To_Sort>");// Use orderByDescending for Descending or orderByAscending for Ascending
storageService.SetOtherMetaHeaders(otherMetaHeaders);
storageService.FindDocumentByKeyValue(dbName,collectionName,key,value, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
			Console.WriteLine("CreatedAt is : " + jsonDocList[i].GetCreatedAt());
			Console.WriteLine("UpdatedAt is : " + jsonDocList[i].GetUpdatedAt());
		} 
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>";
NSString *key = @"name";
NSString *value = @"Nick";
// Use orderByDescending for Descending or orderByAscending for Ascending
NSMutableDictionary *otherMetaHeaders = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"orderByAscending",@"<Name_Of_key_You_Want_To_Sort>", nil];

[storageService setOtherMetaHeaders:otherMetaHeaders];
Storage *storage = [storageService findDocumentByKeyValue:dbName collectionName:collectionName key:key value:value];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is = %@ " , jsonDoc.docId);
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt = %@",jsonDoc.updatedAt);
	NSLog(@"CreatedAt = %@",jsonDoc.createdAt);
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("orderByDescending", "<Name_Of_key_You_Want_To_Sort>");// Use orderByDescending for Descending or orderByAscending for Ascending
storageService.setOtherMetaHeaders(otherMetaHeaders);
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());  
	System.out.println("CreatedAt is " + jsonDoc.getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDoc.getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc());
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("orderByDescending", "<Name_Of_key_You_Want_To_Sort>");// Use orderByDescending for Descending or orderByAscending for Ascending
storageService.setOtherMetaHeaders(otherMetaHeaders);
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
	System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
App42Log.SetDebug(true);		//Print output in your editor console
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("orderByAscending", "<Name_Of_key_You_Want_To_Sort>");// Use orderByDescending for Descending or orderByAscending for Ascending
storageService.SetOtherMetaHeaders(otherMetaHeaders);
storageService.FindDocumentByKeyValue(dbName, collectionName, key, value, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
key = "key",
value = "value",
response ;  
var otherMetaHeaders={orderByAscending:"<Name_Of_key_You_Want_To_Sort>"};//Use orderByDescending for Descending or orderByAscending for Ascending                  
storageService.setOtherMetaHeaders(otherMetaHeaders);
storageService.findDocumentByKeyValue(dbName,collectionName,key,value,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);  
		response = storageObj.app42.response.storage;
		console.log("dbName is " + response.dbName)
	},  
	error: function(error) {  
	}  
}); 
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"
local value = "Nick"
local App42CallBack = {}
otherMetaHeaders.orderByAscending= "<Name_Of_key_You_Want_To_Sort>";//Use orderByDescending for Descending or orderByAscending for Ascending
storageService:setOtherMetaHeaders(otherMetaHeaders);
storageService:findDocumentByKeyValue(dbName, collectionName,key,value,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
map<string,string>otherMetaHeaders;
otherMetaHeaders["orderByAscending"] = "<Name_Of_key_You_Want_To_Sort>";// Use orderByDescending for Descending or orderByAscending for Ascending as key
const char* key="name";
const char* value = "Nick";
storageService->FindDocumentByKeyValue(dbName, collectionName,key,value,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String key = "name"; 
String value = "Nick"; 
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("orderByAscending", "<Name_Of_key_You_Want_To_Sort>");// Use orderByDescending for Descending or orderByAscending for Ascending
storageService.SetOtherMetaHeaders(otherMetaHeaders);
Storage storage = storageService.FindDocumentByKeyValue(dbName,collectionName,key,value);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>";
$key = "name"; 
$value = "Nick"; 
$otherMetaHeaders = array();
$otherMetaHeaders['orderByAscending'] ="<Name_Of_key_You_Want_To_Sort>";//Use orderByDescending for Descending or orderByAscending for Ascending
$storageService->setOtherMetaHeaders($otherMetaHeaders);
$storage = $storageService->findDocumentByKeyValue($dbName,$collectionName,$key,$value); 
print_r("dbName is " . $storage->getDbName());
print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
	print_r("updated at is : " . $jsonDoc->getUpdatedAt());
	print_r("created At is : " . $jsonDoc->getCreatedAt());
}
$jsonResponse = $storage->toString(); 
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";
map<string,string>otherMetaHeaders;
otherMetaHeaders["orderByAscending"] = "<Name_Of_key_You_Want_To_Sort>";// Use orderByDescending for Descending or orderByAscending for Ascending as key
const char* key="name";
const char* value = "Nick";
storageService->FindDocumentByKeyValue(dbName, collectionName,key,value,this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));

void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        for(std::vector<App42Storage>::iterator it = storageResponse->storages.begin(); it != storageResponse->storages.end(); ++it)
        {
            printf("\n DbName=%s",it->dbName.c_str());
            printf("\n CollectionName=%s",it->collectionName.c_str());            
            for(std::vector<JSONDocument>::iterator iit = it->jsonDocArray.begin(); iit != it->jsonDocArray.end(); ++iit)
            {
                printf("\n CreatedAt=%s",iit->getCreatedAt().c_str());
                printf("\n DocId=%s",iit->getDocId().c_str());
                printf("\n Owner=%s",iit->getOwner().c_str());
                printf("\n UpdatedAt=%s",iit->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",iit->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var key:String = "name"; 
var value:String = "Nick"; 
var otherMetaHeaders:Dictionary = new Dictionary();
otherMetaHeaders["orderByAscending"] = "<Name_Of_key_You_Want_To_Sort>";//Use orderByDescending for Descending or orderByAscending for Ascending
storageService.setOtherMetaHeaders(otherMetaHeaders);
storageService.findDocumentByKeyValue(dbName,collectionName,key,value,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Find Specific Key From JSON Document

Find Specific keys from the JSON doc in the database and collection. Note Same can be done in all find methods.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc has to be saved.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
Set<String> selectKeys = new HashSet<String>();
selectKeys.add("<Name_Of_the_Key>");
storageService.setSelectKeys(selectKeys); 
storageService.findAllDocuments(dbName, collectionName, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
HashSet<string> selectKeys = new HashSet<string> ();
selectKeys.Add("Name");
storageService.SetSelectKeys (selectKeys); 
storageService.FindAllDocuments(dbName,collectionName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
		for(int i=0;i <jsonDocList.Count;i++)
		{   
			Console.WriteLine("DocId is : " + jsonDocList[i].GetDocId());
			Console.WriteLine("JSONDoc is : " + jsonDocList[i].GetJsonDoc());
		}  
	}  
}  
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"Your_Collection_Name";
NSMutableArray *selectKeys = [NSMutableArray arrayWithObjects:@"<Name_Of_the_Key>", nil];
[storageService setSelectKeys:selectKeys];
Storage *storage = [storageService findAllDocuments:dbName collectionName:collectionName];
NSLog(@"dbName is %@" , storage.dbName);
NSLog(@"collectionNameId is %@" , storage.collectionName);
NSMutableArray *jsonDocArray = storage.jsonDocArray;
for(JSONDocument *jsonDoc in jsonDocArray)
{
	NSLog(@"objectId is = %@ " , jsonDoc.docId);
	NSLog(@"jsonDoc is = %@ " , jsonDoc.jsonDoc);
	NSLog(@"UpdatedAt = %@",jsonDoc.updatedAt);
	NSLog(@"CreatedAt = %@",jsonDoc.createdAt);
	NSLog(@"Owner=%@",jsonDoc.owner);
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Set<String> selectKeys = new HashSet<String>();
selectKeys.add("<Name_Of_the_Key>");
storageService.setSelectKeys(selectKeys); 
Storage storage = storageService.findAllDocuments(dbName,collectionName);  
System.out.println("dbName is " + storage.getDbName());
Vector JsonDocList = storage.getJsonDocList();   
for(int i=0;i < JsonDocList.size();i++)  
{ 
	Storage.JSONDocument jsonDoc = (Storage.JSONDocument)JsonDocList.elementAt(i);  
	System.out.println("objectId is " + jsonDoc.getDocId());
	System.out.println("Jsondoc is " + jsonDoc.getJsonDoc()); 
}         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
Set<String> selectKeys = new HashSet<String>();
selectKeys.add("<Name_Of_the_Key>");
storageService.setSelectKeys(selectKeys); 
Storage storage = storageService.findAllDocuments(dbName,collectionName);  
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
for(int i=0;i<jsonDocList.size();i++)
{
	System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
	System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
App42Log.SetDebug(true);		//Print output in your editor console
HashSet<string> selectKeys = new HashSet<string> ();
selectKeys.Add("Name");
storageService.SetSelectKeys (selectKeys);
storageService.FindAllDocuments(dbName,collectionName, 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);
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
response ;  
var selectKeys = new Array();
selectKeys.push("<Name_Of_the_Key>");
storageService.setSelectKeys(selectKeys);
storageService.findAllDocuments(dbName,collectionName,{  
	success: function(object) 
	{  
		var storageObj = JSON.parse(object);
		console.log(storageObj)
		response = storageObj.app42.response.storage.jsonDoc;
		if(response.length == undefined)  
		{			
			console.log(response._id.$oid)
		}
	   for(var i=0;i<response.length;i++)  
	   {
			console.log(response[i])
			console.log(response[i]._id.$oid)
			console.log(response[i]._$createdAt)
			console.log(response[i]._$updatedAt)
	   }
	},  
	error: function(error) {  
	}  
}); 

local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local App42CallBack = {}
local selectKeys={}
selectKeys[1]=("<Name_Of_the_Key>");
storageService.setSelectKeys(selectKeys);
storageService:findAllDocuments(dbName, collectionName, App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
	for i=1,table.getn(object:getJsonDocList()) do
		print("DocId is "..object:getJsonDocList()[i]:getDocId())
		print("CreatedAt is "..object:getJsonDocList()[i]:getCreatedAt())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
HashSet<string> selectKeys = new HashSet<string> ();
selectKeys.Add("Name");
storageService.SetSelectKeys (selectKeys);
Storage storage = storageService.FindAllDocuments(dbName,collectionName);  
Console.WriteLine("dbName is " + storage.GetDbName());
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList(); 
for(int i=0;i <jsonDocList.Count;i++)
{   
	Console.WriteLine("objectId is " + jsonDocList[i].GetDocId());
	Console.WriteLine("jsonDoc is " + jsonDocList[i].GetJsonDoc());
}  
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$selectKeys = array();
array_push($selectKeys, "<Name_Of_the_Key>");
$storageService->setSelectKeys($selectKeys);
$storage = $storageService->findAllDocuments($dbName,$collectionName); 
print_r("dbName is :" . $storage->getDbName());
 print_r("Collection Name is :".$storage->getCollectionName());
$jsonDocList = $storage->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId());
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc());
}
$jsonResponse = $storage->toString(); 
Coming Soon
Coming Soon
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var selectKeys:Array =new Array();
selectKeys.push("<Name_Of_the_Key>");
storageService.setSelectKeys(selectKeys);
storageService.findAllDocuments(dbName,collectionName, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{ 
		var storage:Storage = Storage(response);
		trace("dbName is : " + storage.getDbName());
		trace("collectionName is : " + storage.getCollectionName());
		var jsonDoc:JSONDocument = new JSONDocument(); 
		for(var i:int  = 0; i<storage.getJsonDocList().length;i++)
		{						
			jsonDoc = JSONDocument(storage.getJsonDocList()[i]);
			trace("objectId is :  " + jsonDoc.getDocId());
			trace("jsonDoc is :  " + jsonDoc.getJsonDoc());
		}
	}  
}  
Coming Soon 

Get Count By Query

Find target documents count using Custom Query.

Required Parameters

dbName - Unique handler for storage name. collectionName - Name of collection under which JSON doc count needs to be searched. query - Query Object containing custom query for searching docs count.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";  
String key2 = "age";      
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
storageService.getCountByQuery(dbName, collectionName, query, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("Total Record is " + app42response.getTotalRecords()) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});  
Coming Soon
Coming Soon
Coming Soon      
String dbName = "<Enter_the_dbName>";  
String collectionName = "<Your_Collection_Name>";   
String key1 = "name";   
String value1 = "Nick";     
String key2 = "age";   
int value2 = 30;    
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN);	// Build query q2 for key2 equal to age and value2 equal to 30	 
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);   	
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.   
App42Response app42response = storageService.getCountByQuery(dbName,collectionName,query);
System.out.println("Total Records : " + app42response.getTotalRecords()) ;
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString();   
Coming Soon  
Coming Soon           
Coming Soon  
Coming Soon
Coming Soon  
$dbName = "<Enter_the_dbName>";  
$collectionName = "<Your_Collection_Name>";    
$key1 = "name";   
$value1 = "Nick";   
$key2 = "age";     
$value2 = 30;    
$queryBuilder = new QueryBuilder();
$q1 = $queryBuilder->build($key1, $value1, Operator::EQUALS);  // Build query q1 for key1 equal to name and value1 equal to Nick
$q2 = $queryBuilder->build($key2, $value2, Operator::GREATER_THAN);  // Build query q2 for key2 equal to age and value2 equal to 30
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);  	 
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.	
$storage = $storageService->findDocumentsByQuery($dbName,$collectionName,$query);
$jsonResponse = $storage->toString();
print_r("Response :".$jsonResponse);
print_r("Total Count :".$storage->getTotalRecords());
Coming Soon
Coming Soon
Not available
Coming Soon 

Exception Handling

The functions available under Storage API can throw some exceptions in abnormal conditions. An example of the same has been given below. E.g. If an App developer is requesting for the document that does not exist, the function will throw the App42Exception (as shown below) with the message as “Not Found” and the appErrorCode as “2600” and the details as “Document by the Id ‘4faa3f1ac68df147a51f8bd7’ does not exist”.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "4faa3f1ac68df147a51f8bd7";
storageService.findDocumentById(dbName, collectionName, docId, new App42CallBack() {
public void onSuccess(Object response) 
{
	Storage  storage  = (Storage )response;
	System.out.println("dbName is " + storage.getDbName());
	System.out.println("collection Name is " + storage.getCollectionName());
	ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();            
	for(int i=0;i<jsonDocList.size();i++)
	{
		System.out.println("objectId is " + jsonDocList.get(i).getDocId());  
		System.out.println("CreatedAt is " + jsonDocList.get(i).getCreatedAt());  
		System.out.println("UpdatedAtis " + jsonDocList.get(i).getUpdatedAt());  
		System.out.println("Jsondoc is " + jsonDocList.get(i).getJsonDoc());  
	} 
}
public void onException(Exception ex) 
{
	App42Exception exception = (App42Exception)ex;
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 2600)
	{
	// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if(appErrorCode  == 2606)
	{
	// Handle here for Bad Request (Document Id '4faa3f1ac68df147a5' is not valid.)
	}
	else if(appErrorCode == 1401)
	{
	// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
	// handle here for Internal Server Error
	}
	String jsonText = exception.getMessage(); 
}
});	                 
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "4faa3f1ac68df147a51f8bd7";
storageService.FindDocumentById(dbName,collectionName,docId, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
		int appErrorCode = exception.GetAppErrorCode();
		int httpErrorCode = exception.GetHttpErrorCode();
		if(appErrorCode == 2600)
		{
			// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
		}
		else if(appErrorCode  == 2606)
		{
			// Handle here for Bad Request (Document Id '4faa3f1ac68df147a7' is not valid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
		String jsonText = exception.GetMessage(); 
	}  
	public void OnSuccess(Object response)  
	{  
		Storage storage = (Storage) response;
		String jsonResponse = storage.ToString();  
	} 
}  
	
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>"; 
NSString *docId = @"4faa3f1ac68df147a51f8bd7";
@try
{
	Storage *storage = [storageService findDocumentById:dbName collectionName:collectionName docId:docId];
}
@catch(App42Exception exception) 
{
	int appErrorCode = exception.appErrorCode;
	int httpErrorCode = exception.httpErrorCode;
	if(appErrorCode == 2600)
	{
		// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if(appErrorCode  == 2606)
	{
		// Handle here for Bad Request (Document Id '4faa3f1ac68df147' is not valid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	NSString *jsonText = exception.reason; 
}                         
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "4faa3f1ac68df147a51f8bd7";
try
{
	Storage storage = storageService.findDocumentById(dbName, collectionName, docId);
}
catch(App42Exception exception) 
{
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 2600)
	{
		// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if(appErrorCode  == 2606)
	{
		// Handle here for Bad Request (Document Id '4faa3f1ac68df147' is not valid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.getMessage(); 
}      
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "4faa3f1ac68df147a51f8bd7";
try
{
	Storage storage = storageService.findDocumentById(dbName, collectionName, docId);
}
catch(App42Exception exception) 
{
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 2600)
	{
		// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if(appErrorCode  == 2606)
	{
		// Handle here for Bad Request (Document Id '4faa3f1ac68df147' is not valid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.getMessage(); 
}   
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "4faa3f1ac68df147a51f8bd7";
App42Log.SetDebug(true);        //Prints output in your editor console
storageService.FindDocumentById(dbName, collectionName, docId, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnException(Exception exception)
	{
	    App42Exception ex = (App42Exception)exception;
		int appErrorCode = ex.GetAppErrorCode();
        int httpErrorCode = ex.GetHttpErrorCode();
	if(appErrorCode == 2600)
	{
		// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if(appErrorCode  == 2606)
	{
		// Handle here for Bad Request (Document Id '4faa3f1ac68df147a' is not valid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.GetMessage(); 
	}
    
    public void OnSuccess(object response)
    {
		App42Log.Console("Response is :" + response.ToString());
	}
}
var dbName = "<Your_DataBase_Name>",
collectionName = "<Your_Collection_Name>",
docId = "4faa3f1ac68df147a51f8bd7";
var appErrorCode ;
storageService.findDocumentById(dbName, collectionName, docId,{
	success: function(object) {
	},
	error: function(error) 
	{
		var storageObj = JSON.parse(error);
		appErrorCode = storageObj.app42Fault.appErrorCode;
		if(appErrorCode == 2600)
		{
			// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
		}
		else if(appErrorCode  == 2606)
		{
			// Handle here for Bad Request (Document Id '4faa3f1ac68df147' is not valid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
	}
});
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local docId = "4faa3f1ac68df147a51f8bd7"
local App42CallBack = {}
storageService:findDocumentById(dbName, collectionName,docId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("dbName is "..object:getDbName())
end
function App42CallBack:onException(exception)
	local appErrorCode = exception:getAppErrorCode()
	if appErrorCode == 2600 then
			-- Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
		elseif appErrorCode  == 2606 then 
			-- Handle here for Bad Request (Document Id '4faa3f1ac68df147' is not valid.)
		elseif appErrorCode == 1401 then
			-- handle here for Client is not authorized
		elseif appErrorCode == 1500 then
			-- handle here for Internal Server Error
	end
end
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";    
const char* docId = "docId";
storageService->FindDocumentById(dbName, collectionName, docId, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        //Handle Success Response here.
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
        
        int appErrorCode = storageResponse->appErrorCode;
        if(appErrorCode == 2600)
		{
			// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
		}
		else if(appErrorCode  == 2606)
		{
			// Handle here for Bad Request (Document Id '4faa3f1ac68df147a' is not valid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
    }
}
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>"; 
String docId = "4faa3f1ac68df147a51f8bd7";
try
{
	Storage storage = storageService.FindDocumentById(dbName, collectionName, docId);
} 
catch(App42Exception exception)
{
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 2600)
	{
		// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if(appErrorCode  == 2606)
	{
		// Handle here for Bad Request (Document Id '4faa3f1ac68df147a' is not valid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.GetMessage(); 
}          
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
$docId = "4faa3f1ac68df147a51f8bd7";
try
{
	$storage = $storageService->findDocumentById($dbName, $collectionName, $docId);
} 
catch(App42Exception $exception) 
{
	$appErrorCode = $exception->getAppErrorCode();
	$httpErrorCode = $exception->getHttpErrorCode();
	if($appErrorCode == 2600)
	{
		// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
	}
	else if($appErrorCode  == 2606){
		// Handle here for Bad Request (Document Id '4faa3f1ac68df147' is not valid.)
	}
	else if($appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if($appErrorCode == 1500){
		// handle here for Internal Server Error
	}
	$jsonText = $exception->getMessage(); 
}
const char* dbName = "<Your_DataBase_Name>";
const char* collectionName = "<Your_Collection_Name>";    
const char* docId = "docId";
storageService->FindDocumentById(dbName, collectionName, docId, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
        //Handle Success Response here.
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
        
        int appErrorCode = storageResponse->appErrorCode;
        if(appErrorCode == 2600)
		{
			// Handle here for Not Found (Document by the Id '4faa3f1ac68df147a51f8bd7' does not exist.)
		}
		else if(appErrorCode  == 2606)
		{
			// Handle here for Bad Request (Document Id '4faa3f1ac68df147a' is not valid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
    }
}
Coming Soon
Coming Soon
Coming Soon

Error Codes

Functions in Storage API might throw exceptions with following HTTP and Application Error Codes (along with their descriptions):

1400 - BAD REQUEST - The Request parameters are invalid 1401 - UNAUTHORIZED - Client is not authorized. 1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again. 2600 - NOT FOUND - Document by the Id '@docId' does not exist. 2601 - NOT FOUND - Document by key '@key' and value '@value' does not exist. 2602 - NOT FOUND - No document in the collection '@collectionName' exists. 2603 - BAD REQUEST - The request parameters are invalid. Make Sure DB and collection name exists and functions are syntactically correct. 2604 - NOT FOUND - Storage with the name '@storageName' does not exist. 2605 - BAD REQUEST - Invalid Storage Query. 2606 - BAD REQUEST - Document Id '@docId' is not valid. 2608 - NOT FOUND - No document in the collection '@collectionName' exists for given query 2609 - NOT FOUND - The dataBase '@db' has no collections 2610 - BAD REQUEST - The request parameters are invalid. Storage '@storageName' already exists. 2611 - BAD REQUEST - The request parameters are invalid. Make Sure DB name Not contains special characters.