-
We have a db with 2 million documents in prod. I need to export 14 of them to a testing environment. I noticed an option "Use Transform script". But really have no idea how to construct the script. Help please. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
The easiest way to do that is to run a query:
Then export as CSV and import as CSV If you want to do that using import / export (which is important if you want to include attachments, time series, etc). You can filter during the export process (or the import one, for that matter). Here is the relevant script:
Note that this still needs to scan through all the documents in the database. That is why if you just need to push the raw document data, you can do that more easily through CSV. |
Beta Was this translation helpful? Give feedback.
-
Ok. Thanks. |
Beta Was this translation helpful? Give feedback.
-
May I ask what's the syntax to filter on a property? For example, document has a property 'UserName'. How to filter on UserName matching 'ABC' and 'DEF'. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks. Tried it in prod. It takes about 7 minutes to dump 35 documents out of 2.7 million. Does this have any impact on other normal operations? We have a static index on UserName. I think it's more efficient to query on the index and then do dump. Is that possible? |
Beta Was this translation helpful? Give feedback.
The easiest way to do that is to run a query:
Then export as CSV and import as CSV
If you want to do that using import / export (which is important if you want to include attachments, time series, etc). You can filter during the export process (or the import one, for that matter).
Here is the relevant script:
Note that this still needs to scan through all the documents in the database. That is why if you just need to push the raw document data, you can do that more easily through CSV.