@@ -8,7 +8,6 @@ import type {
88import { getPathWhereIdentifier } from '@magnetarjs/types'
99import { filterDataPerClauses } from '@magnetarjs/utils'
1010import { copy } from 'copy-anything'
11- import { pick } from 'filter-anything'
1211import { mapGetOrSet , objGetOrSet } from 'getorset-anything'
1312import { isArray , isNumber , isPlainObject } from 'is-what'
1413import { deleteActionFactory } from './actions/delete.js'
@@ -126,14 +125,7 @@ export const CreatePlugin: MagnetarPlugin<SimpleStoreOptions> = (
126125 if ( docId ) return dataCollectionMap . get ( docId )
127126 // if it's a collection, we must return the dataCollectionMap but with applied query clauses
128127 // but remember, the return type MUST be a map with id as keys and the docs as value
129- const clauses : Clauses = pick ( pluginModuleConfig , [
130- 'query' ,
131- 'where' ,
132- 'orderBy' ,
133- 'limit' ,
134- 'startAfter' ,
135- ] )
136-
128+ const clauses : Clauses = pluginModuleConfig
137129 return filterDataPerClauses ( dataCollectionMap , clauses )
138130 }
139131
@@ -174,14 +166,7 @@ export const CreatePlugin: MagnetarPlugin<SimpleStoreOptions> = (
174166 if ( isNumber ( count ) ) return count
175167
176168 // if we didn't have any cached count yet, we must return the size of the dataCollectionMap but with applied query clauses
177- const clauses : Clauses = pick ( pluginModuleConfig , [
178- 'query' ,
179- 'where' ,
180- 'orderBy' ,
181- 'limit' ,
182- 'startAfter' ,
183- ] )
184-
169+ const clauses : Clauses = pluginModuleConfig
185170 const dataCollectionMap = objGetOrSet ( data , collectionPath , ( ) => new Map ( ) )
186171 const dataFiltered = filterDataPerClauses ( dataCollectionMap , clauses )
187172 return dataFiltered . size
0 commit comments