You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
yes - you can basically enter any query you’d pass to the mongoDB find API. just use the equivalent JSON query syntax in fetchList or whatever you’re using
VM433:1 GET http://localhost:5000/radiks/models/find?$or[][offset]=0&$or[][limit]=20&$or[][author][$ne]=xanderjakeq2.id.blockstack&$or[][notif_for][]=2ba0fcc064b0-45ed-9cac-d8df5054852a&[sort]=-createdAt&$or[][offset]=0&$or[][limit]=20&$or[][author][$ne]=xanderjakeq2.id.blockstack&$or[][mentions]=xanderjakeq2.id.blockstack&$or[][sort]=-createdAt&radiksType=Notification 500 (Internal Server Error)
Hank:
can you post the actual error from radiks-server?
xanderjakeq
MongoError: $or must be an array
at Connection.<anonymous> (C:\Dev\Websites\startups\anylist\server\node_modules\mongodb\lib\core\connection\pool.js:466:61)
at Connection.emit (events.js:189:13)
at processMessage (C:\Dev\Websites\startups\anylist\server\node_modules\mongodb\lib\core\connection\connection.js:364:10)
at TLSSocket.<anonymous> (C:\Dev\Websites\startups\anylist\server\node_modules\mongodb\lib\core\connection\connection.js:533:15)
at TLSSocket.emit (events.js:189:13)
at addChunk (_stream_readable.js:284:12)
at readableAddChunk (_stream_readable.js:265:11)
at TLSSocket.Readable.push (_stream_readable.js:220:10)
at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
Hank:
i see - this seems like a bug in how the JSON gets serialized into URL parameters also, you can’t put those pagination params inside of the $or. it needs to be ‘top level’ to the query. otherwise, mongoDB will be looking for models where offset = 0, for example
xanderjakeq
ahh okay is that bug easy to fix? if so, I could wait before I try doing some workarounds
Hank:
i’m not quite sure. a workaround could be to do 2 separate queries
The text was updated successfully, but these errors were encountered:
The client formats your JSON query, but is turning those HTTP params into a "hash" - at least as to what the server sees. We need to change either that client-side code or the server code to make sure the JSON you're passing be properly deserialized on the server.
From enginnering thread Public slack.
xanderjakeq
Hank:
find.({ $or: [ { <expression1> }, { <expression2> }, ... , { <expressionN> } ] })
The equivalent would be
`fetchList({ $or: [ { }, { }, ... , { } ] })``
Hank
yeah i think that should work.
xanderjakeq 21 hours ago
okay thanks!
I have this
but I'm getting this error
VM433:1 GET http://localhost:5000/radiks/models/find?$or[][offset]=0&$or[][limit]=20&$or[][author][$ne]=xanderjakeq2.id.blockstack&$or[][notif_for][]=2ba0fcc064b0-45ed-9cac-d8df5054852a&[sort]=-createdAt&$or[][offset]=0&$or[][limit]=20&$or[][author][$ne]=xanderjakeq2.id.blockstack&$or[][mentions]=xanderjakeq2.id.blockstack&$or[][sort]=-createdAt&radiksType=Notification 500 (Internal Server Error)
Hank:
can you post the actual error from radiks-server?
xanderjakeq
Hank:
xanderjakeq
Hank:
The text was updated successfully, but these errors were encountered: