@firestore-repository/google-cloud-firestore 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -93,7 +93,7 @@ await repository.delete({ userId: 'user2' });
93
93
  import { condition as $, limit, query, where } from 'firestore-repository/query';
94
94
 
95
95
  // Define a query
96
- const query1 = query(users, where($('profile.age', '>=', 20)), limit(10));
96
+ const query1 = query(users, $('profile.age', '>=', 20), limit(10));
97
97
 
98
98
  // List documents
99
99
  const docs = await repository.list(query1);
@@ -167,7 +167,9 @@ export const toFirestoreQuery = (db, query) => {
167
167
  return (query.constraints?.reduce((q, constraint) => {
168
168
  switch (constraint.kind) {
169
169
  case 'where':
170
- return q.where(toFirestoreFilter(constraint.filter));
170
+ case 'or':
171
+ case 'and':
172
+ return q.where(toFirestoreFilter(constraint));
171
173
  case 'orderBy':
172
174
  return q.orderBy(constraint.field, constraint.direction);
173
175
  case 'limit':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestore-repository/google-cloud-firestore",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "A minimum and universal Firestore ORM (Repository Pattern) for TypeScript",
5
5
  "homepage": "https://github.com/ikenox/firestore-repository",
6
6
  "repository": {
@@ -10,7 +10,7 @@
10
10
  "type": "module",
11
11
  "dependencies": {
12
12
  "@google-cloud/firestore": "^7.10.0",
13
- "firestore-repository": "0.3.0"
13
+ "firestore-repository": "0.4.1"
14
14
  },
15
15
  "exports": {
16
16
  ".": {