go-cloud icon indicating copy to clipboard operation
go-cloud copied to clipboard

docstore/memdocstore query for nested documents with slices does not work

Open eqinox76 opened this issue 1 year ago • 8 comments
trafficstars

Describe the bug

Documents like

docmap{
	"goals": []any{
		docmap{"id": "1145755"},
		docmap{"id": "8336474"},
		docmap{"id": "1474479"},
	},
}

are not found by the following query:

collection.Query().Where("goals.id", "=", "1145755")

This is working fine when using docstore/mongodocstore.

To Reproduce

I forked this repository and added a unit test to show the issue eqinox76/go-cloud@7f3ef044a00cc76d258147fd9e1b529e0b4f8ad9.

Expected behavior

Find the document.

Version

v0.39.0

Additional context

eqinox76/go-cloud@7f3ef044a00cc76d258147fd9e1b529e0b4f8ad9 contains a potential fix. If it looks good to you i could make a pr.

eqinox76 avatar Nov 12 '24 08:11 eqinox76