Hey guys, quick question:
Is there any performance issue on using the
import
method (with upsert option) on a single document rather than using the
upsert
method?
a
Alan Martini
06/20/2025, 2:46 PM
Hey Gabriel,
When using import with upsert, you're essentially overwriting the entire item*, which is simpler and more performant. In contrast, an upsert operation requires finding the item, comparing it, and applying only the changes, making it slightly slower.
However, unless you're working with a large number of documents or very complex ones, the performance difference shouldn't be too noticeable.
Alan Martini
06/20/2025, 3:02 PM
In fact, with a large number of documents, you'll want to use the import function, as it includes a batch feature that is specifically designed for bulk imports. On the other hand, the upsert function is better suited for more atomic operations.