[firestore-bigquery-export] gen-schema-view script - Duplicate entries created when using array types in schema
See original GitHub issue- Extension name:
firestore-bigquery-export
- Extension version: 0.1.16
Amazing extension, this is exactly what I was looking for.
I’m using the gen-schema-view
script with and it works great as long as I don’t have array field types. When I do, it creates duplicate entries in the BigQuery table.
This schema create 116 entries per every firestore document:
{
"fields": [
{
"name": "field1",
"type": "string"
},
{
"name": "field2",
"type": "number"
},
{
"name": "field3",
"type": "array"
},
{
"name": "field4",
"type": "array"
},
{
"name": "field5",
"type": "map",
"fields": [
{
"name": "field5nested1",
"type": "string"
},
{
"name": "field5nested2",
"type": "boolean"
},
{
"name": "field5nested3",
"type": "array"
},
{
"name": "field5nested4",
"type": "array"
}
]
}
]
}
This one doesn’t
{
"fields": [
{
"name": "field1",
"type": "string"
},
{
"name": "field2",
"type": "number"
},
{
"name": "field5",
"type": "map",
"fields": [
{
"name": "field5nested1",
"type": "string"
},
{
"name": "field5nested2",
"type": "boolean"
}
]
}
]
}
I should add that field3
and field4
are array of firestore references, and field5nested3
, field5nested4
are array of maps.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Add an array to Widget Server script to remove duplicates
Solved: Hi, I am needing some help with adding an array to remove duplicate records in the Server script of my custom widget....
Read more >Duplicate data getting added into collection - MongoDB
Hi, I have created a mongoose model as below, and set recordId field to “unique: true” to handle duplicate entry. But when through...
Read more >Allow same array entry in different documents #6264 - GitHub
In my schema, I have a property, keywords, which is an array. Mongoose automatically prevents entering the same array value in different ...
Read more >Duplicate values inside Array in Mongoose Schema
What I am trying to do I have a document with teamid as the unique identifier and name of the team.
Read more >Typescript - Finding Duplicate Elements in an Array
Have you ever wanted to find some duplicate elements in an array? Lets take a look at how to do just that in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Base on that schema I have produced case with the following results…
I suppose the confusion is that this returns
n
amount of rows from a complex structure into aflat
version of the data.Does this adequately replicate the data that you are seeing from your own database?
Yes, it’s good to know that’s the intended behavior. Thank you!