Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check put before get get next #1382

Closed
wants to merge 1 commit into from

Conversation

mblaney
Copy link
Contributor

@mblaney mblaney commented Aug 10, 2024

When get is chained, eve.put['.'] contains the lex match and eve.get contains the parent get, so need to match put first. Given the following example this matches alice instead of friends:

(async () => {

var alice = await SEA.pair();

const gun = Gun();

await gun.user().auth(alice);
    
let userNode = gun.user().get('friends');
userNode.put({
  "alice": {
    parent: false
  },
  "bob": {
    parent: false
  },
  "carol": {
    parent: false
  },
});

setTimeout(() => {
  gun.user().get('friends').get({'.': {'>': 'aaron', '<': 'ben'}}).once().map().once(console.log);
}, 2000);

})();

@mblaney mblaney force-pushed the check-put-before-get-get-next branch from 775efd7 to 9a89d23 Compare August 10, 2024 08:51
@mblaney
Copy link
Contributor Author

mblaney commented Aug 12, 2024

This only works in the example because there's a put before the get, so closing this pr for now. :-(

Need to work out why chained gets don't pass on the key to match against lex.

@mblaney mblaney closed this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant