googleapis / nodejs-firestore

Node.js client for Google Cloud Firestore: a NoSQL document database built for automatic scaling, high performance, and ease of application development.
https://cloud.google.com/firestore/
Apache License 2.0
640 stars 149 forks source link

GeoPoint toString returns 'Object' #471

Closed crwilcox closed 5 years ago

crwilcox commented 5 years ago
> const firestore = require('@google-cloud/firestore')
> (new firestore.GeoPoint(1,1)).toString()
'[object Object]'

This worked in 0.16.0. Expected return is 'GeoPoint { latitude: 1, longitude: 1 }'

crwilcox commented 5 years ago

This was explicitly removed by this commit: https://github.com/googleapis/nodejs-firestore/commit/018c282b5ef912b965f2b1f96817939f1dbf14f6#diff-dc6163f36d650a36b0ad94699f708647

I don't understand why. The issue being that toString will still work and provide a non-ideal result.

If we do it bring it back, a comment was made by a user that we should describe how this returns the data, so adding 'GeoPoint { latitude: 1, longitude: 1 }'. to the docstr could be useful.

schmidt-sebastian commented 5 years ago

This was removed to bring this API in line with the Mobile Web SDK. It was never meant to be there. Are there external requests for this?

schmidt-sebastian commented 5 years ago

Closing as we have not seen any more requests. If we want to add toString() back, then we should evaluate other places in the API where this may make sense.