MongoDB REST API

DB REST API Service

Simple REST API Service for MongoDB

Documentation

Below showing sample code to do the query on the database.
Showing code for
Find all records from a collection
const ret = await axios.post('https://db.8765432.top/db', {
  type: 'find',
  collection: 'your-collection-here',
  find: {},
  limit: 100,
  skip: 0,
}, {
  headers: {
    'database-id': 'your-database-id-here',
    'client-id': 'your-client-id-here',
    'client-secret': 'your-client-secret-here',
  }
})
Find one record from a collection
const ret = await axios.post('https://db.8765432.top/db', {
  type: 'findOne',
  collection: 'your-collection-here',
  find: { id: '[email protected]' },
}, {
  headers: {
    'database-id': 'your-database-id-here',
    'client-id': 'your-client-id-here',
    'client-secret': 'your-client-secret-here',
  }
})
Insert one record into a collection
const ret = await axios.post('https://db.8765432.top/db', {
  type: 'insertOne',
  collection: 'your-collection-here',
  payload: {
    email: '[email protected]',
    name: 'John Doe',
  },
}, {
  headers: {
    'database-id': 'your-database-id-here',
    'client-id': 'your-client-id-here',
    'client-secret': 'your-client-secret-here',
  }
})
Update one record in a collection
const ret = await axios.post('https://db.8765432.top/db', {
  type: 'updateOne',
  collection: 'your-collection-here',
  upsert: false,
  find: { email: '[email protected]' },
  payload: {
    email: '[email protected]',
    name: 'John Doe',
  },
}, {
  headers: {
    'database-id': 'your-database-id-here',
    'client-id': 'your-client-id-here',
    'client-secret': 'your-client-secret-here',
  }
})
Delete one record from a collection
const ret = await axios.post('https://db.8765432.top/db', {
  type: 'deleteOne',
  collection: 'your-collection-here',
  find: { email: '[email protected]' },
}, {
  headers: {
    'database-id': 'your-database-id-here',
    'client-id': 'your-client-id-here',
    'client-secret': 'your-client-secret-here',
  }
})

Disclaimer: This service is provided as-is. We are not responsible for any data loss or stability issues. It is not recommended for production use. Please use at your own risk.

Free to use for personal and commercial projects.
Build by Aisoft Digital. Reach us at [email protected]
#ProjekGodamPuasa (PGP)