gun icon indicating copy to clipboard operation
gun copied to clipboard

Support for LEX's request chaining

Open Buom01 opened this issue 3 years ago • 3 comments

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:

  • [ ] Filtering on the current machine
  • [ ] Filtering on the peers

Supposed limitations:

  • All limitations from the first LEX's query of the chain

Possible issues:

  • Would be harder to be sure that all documents are got

Current state:

Buom01 avatar Jul 11 '22 01:07 Buom01

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

bmatusiak avatar Jul 11 '22 01:07 bmatusiak

Hey,

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

Buom01 avatar Jul 11 '22 04:07 Buom01

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.

amark avatar Jul 13 '22 03:07 amark