Skip to content

Seeding error for fields with Date #13

@arleneadriannego

Description

@arleneadriannego

I have a Timestamp-like field by using new Date() in declaring a seed.

const messagesCollection = seed.collection("messages", [
    seed.doc("message1", {
        content: "Hello firestore-seed.",
        created: new Date(),
    }),
    seed.doc("message2", {
        content: "Good bye firestore-seed.",
        created: new Date(),
    })
]);

But I get an error:

Seeding failed: Error: Value for argument "data" is not a valid Firestore document. Detected an object of type "Timestamp" that doesn't match the expected instance (found in field "created"). Please ensure that the Firestore types you are using are from the same NPM package.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions