amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.03k stars 1.16k forks source link

Support for LEX's request chaining #1259

Open Buom01 opened 2 years ago

Buom01 commented 2 years ago

Feature request for nested LEX's requests like gun.get('position').get({'.': {'>': '25', '<': '50'}})).get({'.': {'>': '10', '<': '20'}). It would offer new opportunities like a base for rough geo-queries.

It could be split it in different step like:

Supposed limitations:

Possible issues:

Current state:

bmatusiak commented 2 years ago

hey thanks for idea!

recently @amark said to focus the usage of lex using .map()

try using map() instead of get() and post back results for that, cheers

Buom01 commented 2 years ago

Hey,

I don't get better luck with map: https://jsfiddle.net/Buom01/x0hf6gu5/14/

amark commented 2 years ago

LEX is being significantly being improved in [a far forward] future version - turns out we only need 1 parameter, not 3.

I think I can approximately make it compatible (since LEX is currently buggy anyways) by choosing > by default, and < for reverse queries (-).

Afterwards, pretty much all GUN queries will be a type of LEX query. Which should make chaining easier too. But fixing the current version is low priority, just heads up.