Updating

Update Mesh data in collection.

Single

Update single mesh data record.

PUT https://api.meshydb.com/{accountName}/meshes/{mesh}/{id} HTTP/1.1
Authorization: Bearer {access_token}
Content-Type: application/json

{
   "firstName": "Bobbo",
   "lastName": "Bobberson"
}

Parameters

accountName : string, required
Indicates which account you are connecting to.
access_token : string, required
Token identifying authorization with MeshyDB requested during Generating Token.
mesh : string, required
Identifies name of mesh collection. e.g. person.
id : string, required
Identifies unique record of Mesh data to replace.
var client = MeshyClient.initialize(accountName, publicKey);

var anonymousUser = await client.registerAnonymousUser();

var meshyConnection = await client.loginAnonymously(anonymousUser.username);

var meshData = await meshyConnection.meshes.update(meshName,
                                                   {
                                                      firstName:"Bob",
                                                      lastName:"Bobberson"
                                                   },
                                                   id);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique user name for authentication.
meshName : string, required
Identifies name of mesh collection. e.g. person.
id : string, required
Identifies unique record of Mesh data to replace.
var client = MeshyClient.Initialize(accountName, publicKey);
var connection = await client.LoginAnonymouslyAsync(username);
var person = await connection.Meshes.GetDataAsync<Person>(id);

person.FirstName = "Bobbo";

person = await connection.Meshes.UpdateAsync(person);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique user name for authentication.
mesh : string, required, default: class name
Identifies name of mesh collection. e.g. person.
id : string, required
Identifies unique record of Mesh data to replace.

Responses

200 : OK
  • Result of updated mesh data.

Example Result

{
   "_id":"5c78cc81dd870827a8e7b6c4",
   "firstName": "Bobbo",
   "lastName": "Bobberson"
}
400 : Bad request
  • Mesh name is invalid and must be alpha characters only.
  • Mesh property cannot begin with ‘$’ or contain ‘.’.
401 : Unauthorized
  • User is not authorized to make call.
403 : Forbidden
  • User has insufficent permission to update meshes or mesh.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.

Many

Bulk update data based on provided filter.

PATCH https://api.meshydb.com/{accountName}/meshes/{mesh} HTTP/1.1
Authorization: Bearer {access_token}
Content-Type: application/json

{
   "filter": filter,
   "update": update
}

Parameters

accountName : string, required
Indicates which account you are connecting to.
access_token : string, required
Token identifying authorization with MeshyDB requested during Generating Token.
mesh : string, required
Identifies name of mesh collection. e.g. person.
filter : string, required
Criteria provided in a MongoDB format to limit results.
update : string, required
Update command provided in a MongoDB format.
var client = MeshyClient.initialize(accountName, publicKey);
var anonymousUser = await client.registerAnonymousUser();
var connection = await client.loginAnonymously(anonymousUser.username);

var result = await connection.meshesService.updateMany(meshName, filter, update);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique user name for authentication.
meshName : string, required
Identifies name of mesh collection. e.g. person.
filter : string, required
Criteria provided in a MongoDB format to limit results.
update : string, required
Update command provided in a MongoDB format.
var client = MeshyClient.Initialize(accountName, publicKey);
var connection = await client.LoginAnonymouslyAsync(username);

var result = await connection.Meshes.UpdateManyAsync<Person>(filter, update);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique user name for authentication.
mesh : string, required, default: class name
Identifies name of mesh collection. e.g. person.
filter : string, required
Criteria provided in a MongoDB format to limit results.
update : string, required
Update command provided in a MongoDB format.

Responses

200 : OK
  • Result of updated mesh data.

Example Result

{
   "isAcknowledged": true,
   "isModifiedCountAvailable": true,
   "matchedCount": 5,
   "modifiedCount": 3,
   "upsertedId": null
}
400 : Bad request
  • Mesh name is invalid and must be alpha characters only.
  • Filter is required.
  • Update is required.
  • Filter is in an invalid format. It must be in a valid Mongo DB format.
  • Update is in an invalid format. It must be in a valid Mongo DB format.
401 : Unauthorized
  • User is not authorized to make call.
403 : Forbidden
  • User has insufficent permission to update meshes or mesh.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.