firestore-migrator icon indicating copy to clipboard operation
firestore-migrator copied to clipboard

import Date fields

Open CodeMasterZeroOne opened this issue 5 years ago • 2 comments

Hello, and thank you for this app, helped me a lot! I am new to firestore and I was able to import my data from xlsx but date fields '2020-01-01' are written to firestore as strings how can I change that to write those as timestamp? Thanks in advance

CodeMasterZeroOne avatar Jul 31 '20 16:07 CodeMasterZeroOne

any progress? to decode string in timestamp

AkshayToraskar avatar Jan 18 '22 19:01 AkshayToraskar

create JSON file with appropriate type, file format as below

{
	"collection:cust": [
		{
			"age": "1/1/2022",
                        "createdAt": "{\"type\":\"timestamp\",\"data\":1641141025}",
			"mobile2": "",
			"name": "test1",
			"locality": "Mumbai",
			"updatedAt": "{\"type\":\"timestamp\",\"data\":1641141025}",
			"mobile": "98989898"
		},
		{
			"locality": "bbbb",
			"updatedAt": "{\"type\":\"timestamp\",\"data\":1641141025}",
			"mobile": "1234567",
			"name": "bbb",
			"mobile2": "",
			"age": "12/1/2022",
			"createdAt": "{\"type\":\"timestamp\",\"data\":1641141025}"
		}
    ]
}

AkshayToraskar avatar Jan 19 '22 05:01 AkshayToraskar