Getting undefined when using FieldValue or FirestoreAdminClient

Viewed 23

as the title suggests I'm trying to use FieldValue and FirestoreAdminClient as follow:

const client = new admin.firestore.v1.FirestoreAdminClient();

And in another function of my server:

await db.doc("stats/users").update({
  total: admin.firestore.FieldValue.increment(1),
});

But when I run my function I get:

TypeError: Cannot read properties of undefined (reading 'FirestoreAdminClient')

I don't know what's happening and why. If you have any suggestion please share it

1 Answers

I don't know what was happening. I uninstalled node completely and re-installed it and it works now.

Related