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

[Vectorize] Remove $vectorize field in the document #532

Closed
maheshrajamani opened this issue Sep 21, 2023 · 3 comments
Closed

[Vectorize] Remove $vectorize field in the document #532

maheshrajamani opened this issue Sep 21, 2023 · 3 comments
Assignees

Comments

@maheshrajamani
Copy link
Contributor

maheshrajamani commented Sep 21, 2023

If an update come in for $vector field directly, remove $vectorize field in the document if it exist.

@vkarpov15 FYI

@Yuqi-Du
Copy link
Contributor

Yuqi-Du commented Sep 21, 2023

"remove" means just set "$vectorize" field as empty string, or delete "$vectorize" field in the whole document?

@maheshrajamani
Copy link
Contributor Author

maheshrajamani commented Sep 21, 2023

If the existing document in the DB is,
{ "id" : "1", "name" : "test", "$vectorize" : "Test data", "$vector" : [0.25,0.25,0.25] }
in this case $vector field would have been generated using $vectorize field data.

and we get an update clause as {"$set" : {"$vector" : [0.11,0.11,0.11]}} where update is directly to $vector field. This should remove $vectorize field when $vector field is updated. Post update document should look as:
{ "id" : "1", "name" : "test", "$vector" : [0.11,0.11,0.11] }

@vkarpov15
Copy link
Collaborator

This is a good suggestion, makes a lot of sense. $vectorize and $vector need to stay in sync.

@sync-by-unito sync-by-unito bot closed this as completed Sep 26, 2023
@sync-by-unito sync-by-unito bot changed the title [Vectorize] Remove $vectorize field in the document [Vectorize] Remove $vectorize field in the document Oct 21, 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

No branches or pull requests

3 participants