use s3 as a nosql storage (with limited support of queries)
npm install s3-nosql
Make sure you have the s3 bucket setup properly and all the credentials setup;
Let's say you want to connect to bucket 'my-db':
const database = require('../s3-nosql');
const myDb = new database('my-db');
And now, if you want to create a new table called 'new-table', simply do
const newTable = myDb.table('new-table');
save(<string: item id>, <data>, callback);
e.g.
newTable.save('user1', {
name: 'John Doe',
address: 'Somewhere over the rainbow'
}, (err, data) => {...})
delete(key, callback)
e.g.
newTable.delete('user', (err, data) => {...})
fetchOne(key, callback)
e.g.
newTable.fetchOne('user1', (err, data) => {...})
This one loads multiple data in parallel
fetchAll(keys, callback)
e.g.
newTable.fetchAll(['user1', 'user2', 'user3'], (err, data) => {...})
Note: since this is a document store, it's not feasible to search by content, so it accepts only document name matching.
find(keyword, callback)
e.g.
newTable.find('u', (err, data) => {...})
This one works like find, but also loads the data to each object.
findWithContent(keyword, callback)
e.g.
newTable.findWithContent('u', (err, data) => {...})