appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.53k stars 3.73k forks source link

[Feature] Firestore support for firebase.firestore.Timestamp() and firebase.firestore.GeoPoint() and reference type. #3741

Open sumitsum opened 3 years ago

sumitsum commented 3 years ago

Summary

Requested by communtity:

Also I think to able to store a Timestamp value it's necessary to use the Firestore API, e.g new firebase.firestore.Timestamp(seconds, nanoseconds) or firebase.firestore.Timestamp.fromDate(new Date("December 10, 1815")). Would this be supported in #3693 ? Also can support for GeoPoint be included?

Note:

  1. It is different from FieldValue.serverTimestamp()
  2. We should also add support for reference type.
  3. Need support for two actions - (a) create (b) search in where clause

Additional Context

Requested on PR https://github.com/appsmithorg/appsmith/issues/3475

tazmaniax commented 3 years ago

Another urgent need is to be able to store a reference to another collection document when adding or updating another document. With the _ref.path field we have the reference path to another document but need a mechanism to convert that string into a Firestore document reference. So assuming AuthUserAddEventDropdown.selectedOptionValue has the String value "events/ZciTEo2EpxEoPMw4OFsx" then method "Add Document to Collection" query body could possibly be...

{
    "name": "{{UserAddFirstNameInput.text}}",
    "surname": "{{UserAddLastNameInput.text}}",
    "email": "{{UserAddEmailAddressInput.text.toLowerCase()}}",
    "role": "{{UserAddRoleInput.text}}",
    "event": "{{firestore.doc(UserAddEventDropdown.selectedOptionValue)}}",
    "createdBy": "{{appsmith.user.email}}"
}

Or following the current implementation of Timestamp and Delete this could be another field called "Reference Value Path", which would be a map of field paths to reference paths...

{ "event": "{{UserAddEventDropdown.selectedOptionValue}}" }

wdyt?

On a side note, Timestamp support was already been added so I guess that can be removed from the issue title and be replaced with Document Reference

tazmaniax commented 3 years ago

This is similar to https://github.com/appsmithorg/appsmith/issues/7176

GreenFlux commented 7 months ago

Another user is requesting support for Firebase timestamps: https://discord.com/channels/725602949748752515/1221163808706400317/1221163808706400317