https://github.com/worldbrain/storex-backend-firestore
Firestore backend for Storex
https://github.com/worldbrain/storex-backend-firestore
Last synced: about 1 year ago
JSON representation
Firestore backend for Storex
- Host: GitHub
- URL: https://github.com/worldbrain/storex-backend-firestore
- Owner: WorldBrain
- License: mit
- Created: 2019-02-15T16:10:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-06T13:34:03.000Z (about 1 year ago)
- Last Synced: 2025-04-09T21:30:24.604Z (about 1 year ago)
- Language: TypeScript
- Size: 118 KB
- Stars: 3
- Watchers: 8
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
Firestore backend for [Storex](https://github.com/WorldBrain/storex).
Usage
=====
```
$ npm install @worldbrain/storex @worldbrain/storex-backend-firestore
````
See main Storex repo for futher docs
Limitations
===========
- You can only sort by one field, and that field must be the one you're filtering by ([Firestore docs](https://firebase.google.com/docs/firestore/query-data/order-limit-data))
- You cannot use the `$ne` operator ([Firestore docs](https://firebase.google.com/docs/firestore/query-data/queries#query_limitations))
- No logical ORs ([Firestore docs](https://firebase.google.com/docs/firestore/query-data/queries#query_limitations))
- Skipping the first X items in an ordered retrieve is done client-side, so it is recommended to increase the lower limit of your resultset instead (`findObjects({foo: {$gt: X + Y}})` rather than `findObjects({foo: {$gt: X}, {skip: Y}})`)
TBD
===
- Automatic security rule generation
- Ability to easily move StorageModules to Firebase Functions
- Back-end agnostic automatic processes, which whould be Firebase Functions listening to certain queries in this backend
- Subcollection support (after investigations on real-world performance benefits)
- Media field support integrating with Firebase Cloud Storage
Note: Firebase Realtime database support should be a separate back-end
Development
===========
Create a new Firebase project for unit testing, and create the file `/private/firebase.json` (in `.gitgnore` so it doesn't accidentally go public) with the following contents:
```
{
"apiKey": "xxxx",
"authDomain": "xxx.firebaseapp.com",
"databaseURL": "https://xxxx.firebaseio.com",
"projectId": "xxxxx",
"storageBucket": "xxxx.appspot.com",
"messagingSenderId": "xxxxx"
}
```
Then continuously run the tests while developing:
```
$ npm run test:watch
```