Closed ghayman closed 3 years ago
Turns out that the issue is not with computed property names but the fact that 'devices' above was defined as optional in the Interface. Also, updated the type definition for Map fields
e.g. interface Devices { optionalField?: {
} requiredField: {
}
await db.update(users, uid, [ db.field(['optionalField', token], { osType, modifiedAt: new Date(), }), ]);
fails with "Type 'string' is not assignable to type 'never'."
await db.update(users, uid, [ db.field(['requireField', token], { osType, modifiedAt: new Date(), }), ]);
works fine. Not sure if this is the expected behavior or not but this is how I worked around it.
Having trouble getting Typosaurus accepting this update
`
await admin.firestore().collection('users').doc(context.auth!.uid).set({
}, {merge: true}); `
Fields() doesn;t seem to want to take the derived property name - [
${token}
]Any pointers?
Sorry if this not the right place to ask - I couldn't see any other discussion places.
Thanks!e