I noticed different behavior between documents().import(, { action: "emplace" }) and documents().upsert(, { action: "emplace"}), with the latter working with the behavior of an upsert instead of update when a partial document is passed.
In src/Typesense/Documents.ts:220, the DocumentWriteParameters action property is overwritten by the Object.assign call, negating the ability to pass an action to the upsert call.
Are all actions valid for the upsert call? Perhaps the line could be changed to
Object.assign({}, options, { action: options.action ?? "upsert" })
I noticed different behavior between
documents().import(, { action: "emplace" })anddocuments().upsert(, { action: "emplace"}), with the latter working with the behavior of anupsertinstead ofupdatewhen a partial document is passed.In src/Typesense/Documents.ts:220, the
DocumentWriteParametersactionproperty is overwritten by theObject.assigncall, negating the ability to pass an action to theupsertcall.Are all
actionsvalid for theupsertcall? Perhaps the line could be changed to