# SQLite Document DB
npm install sqlite-document-dbUse SQLite as a JSON Document Database.
API based on MongoDB's JavaScript API.
1. Install using NPM:
```
npm i --save sqlite-document-db
2. Start using it:
`javascript
import Db from 'sqlite-document-db'
const db = await Db.fromUrl(':memory:') // Can also be a path to your DB file
// Insert some users into a collection
await db.collection('users').insertOne({ username: 'test_user', email: 'test@example.com' })
await db.collection('users').insertMany([
{ username: 'test_user2', email: 'test2@example.com' },
{ username: 'test_user3', email: 'test3@example.com' },
])
const user = await db.collection('users').findOne({ email: 'test3@example.com' })
console.log(user)
`
Console output of the above:
`javascript``
{
_id: '626964400e547e782d04d7f1',
username: 'test_user2',
email: 'test2@example.com'
}
Thanks to