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

Use one implementation for finding path values #3087

Merged
merged 58 commits into from
Aug 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bce806c
create initial common implementation
chilagrow Jul 20, 2023
c4073da
rename
chilagrow Jul 20, 2023
d0c0334
distinct uses new impl
chilagrow Jul 20, 2023
33936ff
use new function in filter
chilagrow Jul 20, 2023
aea192d
some cleaning
chilagrow Jul 20, 2023
4594b67
update doc
chilagrow Jul 20, 2023
3a693bd
re-organise filter pair code
chilagrow Jul 20, 2023
1ef1ef9
handle empty key for filter
chilagrow Jul 20, 2023
bee2816
add tests, comments and refactor
chilagrow Jul 21, 2023
d1b8ff0
tidy up
chilagrow Jul 21, 2023
2e0eff7
Merge branch 'main' into issue-2348-get-path-value
chilagrow Jul 21, 2023
9e188b5
fix merge
chilagrow Jul 21, 2023
5ce3f80
fix merge
chilagrow Jul 21, 2023
7b65633
reorganise
chilagrow Jul 21, 2023
876744d
Merge branch 'main' into issue-2348-get-path-value
mergify[bot] Jul 24, 2023
292d897
Merge branch 'main' into issue-2348-get-path-value
mergify[bot] Jul 24, 2023
d0be65d
Merge branch 'main' into issue-2348-get-path-value
mergify[bot] Jul 24, 2023
cc4af16
Merge branch 'main' into issue-2348-get-path-value
mergify[bot] Jul 24, 2023
15aaf03
Merge branch 'main' into issue-2348-get-path-value
mergify[bot] Jul 24, 2023
faf7daa
Merge branch 'main' into issue-2348-get-path-value
mergify[bot] Jul 24, 2023
ae4f67d
Refactor `types.Path` a bit
AlekSi Jul 24, 2023
fc446a3
Small tweaks
AlekSi Jul 24, 2023
0313d17
update test
chilagrow Jul 26, 2023
51c106b
merge
chilagrow Jul 26, 2023
1d5051f
checkpoint
chilagrow Jul 26, 2023
20c464a
Tweak documentation a little bit
AlekSi Jul 26, 2023
aa74542
another checkpoint
chilagrow Jul 26, 2023
7bf0bdd
Merge branch 'issue-2348-get-path-value' of github.com:chilagrow/Ferr…
chilagrow Jul 26, 2023
789bae3
some update
chilagrow Jul 26, 2023
2885c85
more comment
chilagrow Jul 27, 2023
76f0724
projection returns correct error code
chilagrow Jul 27, 2023
b31332f
fmt
chilagrow Jul 27, 2023
85f509d
Merge branch 'main' into issue-2348-get-path-value
chilagrow Jul 27, 2023
74d4fc1
path does not return error on $ prefix
chilagrow Jul 27, 2023
ca376f4
Revert "projection returns correct error code"
chilagrow Jul 27, 2023
8147dfe
add todo for fixing projection positional operator
chilagrow Jul 27, 2023
e2fc0ff
aggregation projection checks valid path
chilagrow Jul 27, 2023
bac5eeb
add todo
chilagrow Jul 27, 2023
9f19a76
fmt
chilagrow Jul 27, 2023
8a41dc4
Merge branch 'main' into issue-2348-get-path-value
chilagrow Jul 27, 2023
d7c16a0
Revert "aggregation projection checks valid path"
chilagrow Jul 28, 2023
7e49bd4
review comment
chilagrow Jul 28, 2023
3811585
renaming
chilagrow Jul 28, 2023
bc74089
test empty and space keys for insert and find
chilagrow Jul 28, 2023
1316e0c
Revert "test empty and space keys for insert and find"
chilagrow Jul 28, 2023
ea14b20
clean up
chilagrow Jul 28, 2023
b047e14
Merge branch 'main' into issue-2348-get-path-value
AlekSi Aug 1, 2023
e00bd95
update expression documentation
chilagrow Aug 1, 2023
9c4899c
Merge branch 'issue-2348-get-path-value' of github.com:chilagrow/Ferr…
chilagrow Aug 1, 2023
b706f91
update comment
chilagrow Aug 1, 2023
aa3fecd
Merge branch 'main' into issue-2348-get-path-value
chilagrow Aug 2, 2023
f2f0106
update expression comments
chilagrow Aug 2, 2023
b93ea91
more comments
chilagrow Aug 2, 2023
8b205c2
from pairing session
chilagrow Aug 2, 2023
7c0c76f
add more comments
chilagrow Aug 3, 2023
fd19a7a
more update of inline comments
chilagrow Aug 3, 2023
76a63cf
minor comment update
chilagrow Aug 3, 2023
307792e
resolve merge conflict
chilagrow Aug 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor comment update
  • Loading branch information
chilagrow committed Aug 3, 2023
commit 76a63cf10e1f798566a0d39b8257f4d3cdbf0a35
4 changes: 1 addition & 3 deletions internal/handlers/commonpath/commonpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type FindValuesOpts struct {
FindArrayIndex bool
chilagrow marked this conversation as resolved.
Show resolved Hide resolved
}

// FindValues returns values found at path. Unlike document.GetByPath it may find multiple values.
// FindValues returns values by path, looking up into arrays.
//
// It iterates path elements, at each path element it adds to next values to iterate:
// - if it is a document and has path, it adds the document field value to next values;
Expand All @@ -51,8 +51,6 @@ type FindValuesOpts struct {
// it adds field value of all documents that have path to next values.
//
// It returns next values after iterating path elements.
//
// FindValues returns values by path, looking up into arrays.
func FindValues(doc *types.Document, path types.Path, opts *FindValuesOpts) ([]any, error) {
if opts == nil {
opts = new(FindValuesOpts)
Expand Down