Deleting

Delete mesh data from a collection is permanent. If you desire to retain your data one possible pattern to consider would be a soft-delete pattern.

Single

Delete a specific record of data.

DELETE https://api.meshydb.com/{accountName}/meshes/{mesh}/{id} HTTP/1.1
Authorization: Bearer {access_token}

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 remove.
var client = MeshyClient.initialize(accountName, publicKey);

var anonymousUser = await client.registerAnonymousUser();

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

await meshyConnection.meshes.delete(meshName, 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.
mesh : string, required
Identifies name of mesh collection. e.g. person.
id : string, required
Identifies unique record of Mesh data to remove.
var client = MeshyClient.Initialize(accountName, publicKey);
var connection = await client.LoginAnonymouslyAsync(username);

await connection.Meshes.DeleteAsync(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.
meshName : string, required, default: class name
Identifies name of mesh collection. e.g. person.
id : string, required
Identifies unique record of Mesh data to remove.

Responses

204 : No Content
  • Mesh has been deleted successfully.
400 : Bad request
  • Mesh name is invalid and must be alpha characters only.
401 : Unauthorized
  • User is not authorized to make call.
403 : Forbidden
  • User has insufficent permission to delete meshes or mesh.
404 : Not Found
  • Mesh data was not found.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.

Many

Delete all objects with the provided filter.

DELETE https://api.meshydb.com/{accountName}/meshes/{mesh}?filter={filter} HTTP/1.1
Authorization: Bearer {access_token}

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.
var client = MeshyClient.initialize(accountName, publicKey);
var anonymousUser = await client.registerAnonymousUser();
var connection = await client.loginAnonymously(anonymousUser.username);

var data = await connection.meshesService.deleteMany(meshName, filter)

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, default: class name
Identifies name of mesh collection. e.g. person.
filter : object, required
Criteria provided in a MongoDB format to limit results.
var client = MeshyClient.Initialize(accountName, publicKey);
var connection = await client.LoginAnonymouslyAsync(username);

var result = connection.Meshes.DeleteMany<DeleteManyTest>(filter);

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, default: class name
Identifies name of mesh collection. e.g. person.
filter : string, required
Criteria provided in a MongoDB format to limit results.

Responses

200 : OK
  • Mesh data found with given search criteria and successfully deleted.

Example Result

{
   "deletedCount": 5,
   "isAcknowledged": true
}
400 : Bad request
  • Mesh name is invalid and must be alpha characters only.
  • Filter was not provided.
  • Filter is in an invalid format.
401 : Unauthorized
  • User is not authorized to make call.
403 : Forbidden
  • User has insufficent permission to delete meshes or mesh.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.