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

Add support for Vector field type #6

Open
JaredHatfield opened this issue May 5, 2024 · 1 comment · May be fixed by #9
Open

Add support for Vector field type #6

JaredHatfield opened this issue May 5, 2024 · 1 comment · May be fixed by #9

Comments

@JaredHatfield
Copy link
Member

Firestore has introduced a new field type of "Vector" which is Pre-GA at this time. This new field type is not supported by firestoreproto2map and therefore won't be supported for generating the map object until it is added.

https://cloud.google.com/firestore/docs/concepts/data-types

@JaredHatfield
Copy link
Member Author

Some research was done on this topic and documented UnitVectorY-Labs/firestoreproto2json#21 (comment)

The relevant point for firestoreproto2map is that the vector object representation is actually already stored as a Map in the Firestore document for the underlying protocol buffers.

While the Python and Node.JS library have been enhanced to this as a Map (see the relevant code snippet in the node.js library where this map is handled as a special case https://github.com/googleapis/nodejs-firestore/blob/392ecf37d3ead79b90e5bbe9e54ca677a026c525/dev/src/convert.ts#L166) this poses challenges for how this should be handled here.

There is no Java object Google has created at this time to represent a vector. Therefore the current implementation converts these into a map successfully without any changes.

The best approach here is to leave this code unchanged at this time as the goal is to have compatibility with the Map so it can be inserted into Firestore and maintain compatibility.

The next step is that: manually insert a map into Firestore that matches this and see if the Firestore console shows that it is in fact being treated as a Vector or is it somehow treated as a Map that matches the exact structure of a Vector.

JaredHatfield added a commit that referenced this issue May 12, 2024
@JaredHatfield JaredHatfield linked a pull request May 12, 2024 that will close this issue
JaredHatfield added a commit that referenced this issue May 12, 2024
JaredHatfield added a commit that referenced this issue May 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 a pull request may close this issue.

1 participant