Comments (4)
Yeah, this is awkward. I think the IStorage query functions should accept an array of queries which would work in the same way as sync queries:
workspace.documents([
{pathPrefix: "/about/"},
{pathPrefix: "/wiki/"},
])
It would also still accept a single query object, or no query at all:
documents(q?: Query | Query[]) => Document[]
Matching against one query object, a document has to match EVERY property in the query. E.g. every property in a query object narrows down the search.
Overall, it would return documents that match ANY of the queries in the array. E.g. each additional query in the array broadens the search.
Would you be open to changing the GraphQL query to work this way instead of having arrays within one query object? I think this combination of narrowing and broadening will allow us to express complex queries.
from earthstar.
See also #47 (More comprehensive query options) for ideas about revamping query objects
from earthstar.
@cinnamon-bun I like this, and I'm definitely opening to changing how filters work in earthstar-graphql. Sure it's a little more complex, but I'm not too worried as GraphQL will be able to help people understand how to make valid filters.
from earthstar.
I've gotten stuck: what to do with the limit
field? It makes sense to limit each query inside its own object, but what if you want an overall limit?
Maybe you just can't do that.
from earthstar.
Related Issues (20)
- Upgrade SQLite3 dependency to 0.8.0
- Address private set intersection exploit HOT 2
- What is the rationale for the generateAuthorKeypair shortname only allowing lengths of 4 chars? HOT 1
- npm install error HOT 1
- Adding denoKV to doc drivers HOT 4
- ReplicaCache#onCacheUpdated not triggered until you call cache.queryDocs()? HOT 3
- Error compiling typescript file that imports earthstar npm package
- ExtensionKnownShares loading known shares from memory HOT 1
- Export a browser entrypoint with IndexedDB StorageDriver
- Port Discovery API + DiscoveryLan
- Add way to check if Auth has been set up yet
- Add way to check if given password is correct on Auth
- Auth should be an EventTarget and emit events
- Peer should be an EventTarget and emit events
- IdentityKeypair + ShareKeypair secretKey property should be Base32 encoded string
- "All-in-one" authorisation
- Lots of duplicate auth stuff in the store HOT 5
- Filter sparse documents from store results unless specifically requested
- Cinn25519 shortname encoding is incorrect
- TypeError: The input must be a Uint8Array, a string, or an ArrayBuffer. Received a value of the type undefined. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from earthstar.