# s3-nosql

> use s3 as a datastore for nosql (limited query support).

Latest version **1.2.1** (published 2017-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install s3-nosql
pnpm add s3-nosql
yarn add s3-nosql
bun add s3-nosql
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2017-04-13 |
| First published | 2017-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Bruce B Li |
| Maintainers | coreorm |
| Keywords | s3, nosql, json |

## Links

- npm: https://www.npmjs.com/package/s3-nosql
- Repository: https://coreorm@github.com/coreorm/s3-nosql
- Homepage: https://github.com/coreorm/s3-nosql#readme
- Issues: https://github.com/coreorm/s3-nosql/issues
- npm.io page: https://npm.io/package/s3-nosql

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^2.3.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.40.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.1 (latest) — 2017-04-13
- 1.2.0 — 2017-04-13
- 1.1.0 — 2017-04-12
- 1.0.0 — 2017-04-11

## README

# s3-nosql
use s3 as a nosql storage (with limited support of queries)

## install
`npm install s3-nosql`

## setup
Make sure you have the s3 bucket setup properly and all the credentials setup; 

## Usage 
Let's say you want to connect to bucket 'my-db':

```javascript
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
```javascript
const newTable = myDb.table('new-table');
```

### save one item
```
save(<string: item id>, <data>, callback); 
```

e.g.
```
newTable.save('user1', {
    name: 'John Doe',
    address: 'Somewhere over the rainbow'
}, (err, data) => {...})
```

### delete one item
```javascript
delete(key, callback)
```
e.g.

```
newTable.delete('user', (err, data) => {...})
```

### fetch one item by id
```javascript
fetchOne(key, callback)
```
e.g.
```javascript
newTable.fetchOne('user1', (err, data) => {...})
```

### fetch many items by ids
This one loads multiple data in parallel
```javascript
fetchAll(keys, callback)
```
e.g.
```javascript
newTable.fetchAll(['user1', 'user2', 'user3'], (err, data) => {...})
```

### find all under the table
Note: since this is a document store, it's not feasible to search by content, so it accepts only document name matching.
```javascript
find(keyword, callback)
```
e.g.
```
newTable.find('u', (err, data) => {...})
```

### find and load content to all the objects
This one works like find, but also loads the data to each object.
```javascript
findWithContent(keyword, callback)
```
e.g.
```javascript
newTable.findWithContent('u', (err, data) => {...})
```

---
_Source: https://npm.io/package/s3-nosql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
