Skip to main content
Version: 2.8.y

Array

This section discusses how FirelordJS handle array quirks.

Direct Nested Array

Direct nested array type is array type where its element type is also an array, eg: number[][] and { a: string[][] }[], such types are invalid in Firestore(throw in runtime).

info

indirect nested array is a valid type, eg: { a:string[] }[] and { a:{ b:string[] }[] }[]

If you accidentally defined a direct nested array type, FirelordJS will replace it with an error message.

direct nested array

Filter with Partial Member Object Array

One of the common mistake people make is trying to filter with partial member object array.

filter with partial member get nothing

If you want to filter with object array, you have to filter with the exact shape of the object(all members must present), or else it wont match any of it.

Unless such object element truly exist, then you will get something, but this also mean you have two data types and something is wrong.

This is not FirelordJS limitation, this is how Firestore works.