String dbName = "test";
String collectionName = "foo";
String json = "{\"employeeName\":\"Nick\"}";
App42Callback requestCallback = this; /* This function used the App42Callback interface */
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.BuildStorageService();
storageService.InsertJSONDocument(dbName,collectionName,json,requestCallback);
OnSuccess(Object obj)
{
Storage storage = (Storage) obj;
String jsonResponse = storage.ToString();
}
public class CallBack : App42Callback
{
public override void OnSuccess(Object obj)
{
Storage storage = (Storage) obj;
//Do whatever you want with the object
}
public override void OnException(App42Exception e)
{
//Do whatever you want with the exception
}
}
String dbName = "test";
String collectionName = "foo";
String json = "{\"employeeName\":\"Nick\"}";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);
String jsonResponse = storage.toString();
String dbName = "test";
String collectionName = "foo";
String json = "{\"employeeName\":\"Nick\"}";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);
String jsonResponse = storage.toString();
NSString *dbName = @"test"; NSString *collectionName = @"foo"; NSString *json = @"employeeName\":\"Nick"; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; StorageService *storageService = [serviceAPIObj buildStorageService]; Storage *storage = [storageService insertJSONDocument:dbName collectionName:collectionName json:json]; NSString *jsonResponse = [storage toString];
String dbName = "test";
String collectionName = "foo";
String json = "{\"employeeName \":\"Nick\"}";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.insertJSONDocument(dbName,collectionName,json);
String jsonResponse = storage.toString();
String dbName = "test";
String collectionName = "foo";
String json = "{\"employeeName \":\"Nick\"}";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.BuildStorageService();
Storage storage = storageService.InsertJSONDocument(dbName,collectionName,json);
String jsonResponse = storage.ToString();
dbName = "test";
collectionName = "foo";
json = "{\"employeeName \":\"Nick\"}";
api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>");
storageService = api.buildStorageService();
storage = storageService.insert_json_document(dbName,collectionName,json);
jsonResponse = storage.to_s();
The request format for insertJSONDocument is
URL : https://api.shephertz.com/cloud/1.0/storage/insert/dbName/{dbName}/collectionName/{collectionName}
Method : POST
QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP>
Accept : application/json
Content-Type : application/json
Body : {"app42": {"storage": {"dbName": "test","collectionName": "foo"}}}
var storage = new App42Storage();
var dbName = "dbName";
var collectionName = "collectionName";
var json = "{\"employeeName \":\"Nick\"}";
// In order to use the various functions available under a particular API, a developer will have to call the
// App42.initialize method by passing the apiKey and the secretKey.
App42.initialize("<API_KEY>","<SECRET_KEY>");
storage.insertJSONDocument(dbName, collectionName, json,{
success: function(object) {
// Storage Object creation
},
error: function(error) {
// Storage exception handled
}
});
$dbName = "test";
$collectionName = "foo";
$json = "{\"employeeName \":\"Nick\"}";
$api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
$storageService = $api->buildStorageService();
$storage = $storageService->insertJSONDocument($dbName, $collectionName, $json);
$jsonResponse = $storage->toString();
String dbName = "test";
String collectionName = "foo";
String key = "employeeName";
String value = "Nick";
App42Callback requestCallback = this; /* This function used the App42Callback interface */
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.BuildStorageService();
storageService.FindDocumentByKeyValue(dbName,collectionName,key,value,requestCallback);
OnSuccess(Object obj)
{
Storage storage = (Storage) obj;
String jsonResponse = storage.ToString();
}
public class CallBack : App42Callback
{
public override void OnSuccess(Object obj)
{
Storage storage = (Storage) obj;
//Do whatever you want with the object
}
public override void OnException(App42Exception e)
{
//Do whatever you want with the exception
}
}
String dbName = "test";
String collectionName = "foo";
String key = "employeeName";
String value = "Nick";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);
String jsonResponse = storage.toString();
String dbName = "test";
String collectionName = "foo";
String key = "employeeName";
String value = "Nick";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);
String jsonResponse = storage.toString();
NSString *dbName = @"test"; NSString *collectionName = @"foo"; NSString *key = @"employeeName"; NSString *value = @"Nick"; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; StorageService *storageService = [serviceAPIObj buildStorageService]; Storage *storage = [storageService findDocumentByKeyValue:dbName collectionName:collectionName key:key value:value]; NSString *jsonResponse = [storage toString];
String dbName = "test";
String collectionName = "foo";
String key = "employeeName";
String value = "Nick";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.findDocumentByKeyValue(dbName,collectionName,key,value);
String jsonResponse = storage.toString();
String dbName = "test";
String collectionName = "foo";
String key = "employeeName";
String value = "Nick";
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.BuildStorageService();
Storage storage = storageService.FindDocumentByKeyValue(dbName,collectionName,key,value);
String jsonResponse = storage.ToString();
dbName = "test";
collectionName = "foo";
key = "employeeName";
value = "Nick";
api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>");
storageService = api.buildStorageService();
storage = storageService.find_document_by_key_value(dbName,collectionName,key,value);
jsonResponse = storage.to_s();
The request format for findDocumentByKeyValue is
URL : https://api.shephertz.com/cloud/1.0/storage/findDocByKV/dbName/{dbName}/collectionName/{collectionName}/{key}/{value}
Method : GET
QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP>
Accept : application/json
Content-Type : application/json
var storage = new App42Storage();
var dbName = "dbName";
var collectionName = "collectionName";
var key = "employeeName";
var value = "Nick";
// In order to use the various functions available under a particular API, a developer will have to call the
// App42.initialize method by passing the apiKey and the secretKey.
App42.initialize("<API_KEY>","<SECRET_KEY>");
storage.findDocumentByKeyValue(dbName, collectionName, key, value,{
success: function(object) {
// Storage Object creation
},
error: function(error) {
// Storage exception handled
}
});
$dbName = "test";
$collectionName = "foo";
$key = "employeeName";
$value = "Nick";
$api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
$storageService = $api->buildStorageService();
$storage = $storageService->findDocumentByKeyValue($dbName, $collectionName, $key, $value);
$jsonResponse = $storage->toString();
String dbName = "test";
String collectionName = "foo";
Query q1 = QueryBuilder.build("NickScore", 300, Operator.LESS_THAN_EQUALTO);
Query q2 = QueryBuilder.build("name", "", Operator.LIKE);
Query q3 = QueryBuilder.compoundOperator(q1, Operator.AND, q2);
App42Callback requestCallback = this; /* This function used the App42Callback interface */
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.BuildStorageService();
storageService.FindDocumentsByQuery(dbName,collectionName,q3,requestCallback);
OnSuccess(Object obj)
{
Storage storage = (Storage) obj;
String jsonResponse = storage.ToString();
}
public class CallBack : App42Callback
{
public override void OnSuccess(Object obj)
{
Storage storage = (Storage) obj;
//Do whatever you want with the object
}
public override void OnException(App42Exception e)
{
//Do whatever you want with the exception
}
}
String dbName = "test";
String collectionName = "foo";
Query q1 = QueryBuilder.build("NickScore", 300, Operator.LESS_THAN_EQUALTO);
Query q2 = QueryBuilder.build("name", "", Operator.LIKE);
Query q3 = QueryBuilder.compoundOperator(q1, Operator.AND, q2);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,q3);
String jsonResponse = storage.toString();
String dbName = "test";
String collectionName = "foo";
Query q1 = QueryBuilder.build("NickScore", 300, Operator.LESS_THAN_EQUALTO);
Query q2 = QueryBuilder.build("name", "", Operator.LIKE);
Query q3 = QueryBuilder.compoundOperator(q1, Operator.AND, q2);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,q3);
String jsonResponse = storage.toString();
Coming Soon...
String dbName = "test";
String collectionName = "foo";
Query q1 = QueryBuilder.build("NickScore", 300, Operator.LESS_THAN_EQUALTO);
Query q2 = QueryBuilder.build("name", "", Operator.LIKE);
Query q3 = QueryBuilder.compoundOperator(q1, Operator.AND, q2);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.findDocumentsByQuery(dbName,collectionName,q3);
String jsonResponse = storage.toString();
String dbName = "test";
String collectionName = "foo";
Query q1 = QueryBuilder.Build("NickScore", 300, Operator.LESS_THAN_EQUALTO);
Query q2 = QueryBuilder.Build("name", "", Operator.LIKE);
Query q3 = QueryBuilder.CompoundOperator(q1, Operator.AND, q2);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
StorageService storageService = api.buildStorageService();
Storage storage = storageService.FindDocumentsByQuery(dbName,collectionName,q1);
String jsonResponse = storage.ToString();
dbName = "test";
collectionName = "foo";
op = App42::Storage::QueryBuilder::Operator.new();
qb = App42::Storage::QueryBuilder.new();
q1 = qb.build("NickScore", 300, op.enum("LESS_THAN_EQUALTO"));
q2 = qb.build("name", "", op.enum("LIKE"));
q3 = qb.compoundOperator(q1, op.enum("AND"), q2);
api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>");
storageService = api.buildStorageService();
storage = storageService.find_documents_by_query(dbName, collectionName, q3);
jsonResponse = storage.to_s();
Coming Soon...
Coming Soon...
$dbName = "test";
$collectionName = "foo";
$query = new QueryBuilder();
$q1 = $query->build("NickScore", 300, Operator::LESS_THAN_EQUALTO);
$q2 = $query->build("name", "", Operator::LIKE);
$q3 = $query->compoundOperator($q1, Operator::ANDop, $q2);
$api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
$storageService = $api->buildStorageService();
$storage = $storageService->findDocumentsByQuery($dbName,$collectionName,$q3);
$jsonResponse = $storage->toString();