Skip to content

Commit 11164c2

Browse files
committed
Allow options in document export
1 parent 7e3b7de commit 11164c2

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/typesense/documents.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def import(documents, options = {})
5252
end
5353
end
5454

55-
def export
56-
@api_call.get(endpoint_path('export'))
55+
def export(options = {})
56+
@api_call.get(endpoint_path('export'), options)
5757
end
5858

5959
def search(search_parameters)

spec/typesense/documents_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,13 @@
190190
.with(headers: {
191191
'X-Typesense-Api-Key' => typesense.configuration.api_key,
192192
'Content-Type' => 'application/json'
193+
},
194+
query: {
195+
'include_fields' => 'field1'
193196
})
194197
.to_return(status: 200, body: "#{JSON.dump(document)}\n#{JSON.dump(document)}")
195198

196-
result = companies_documents.export
199+
result = companies_documents.export(include_fields: 'field1')
197200

198201
expect(result).to eq("#{JSON.dump(document)}\n#{JSON.dump(document)}")
199202
end

0 commit comments

Comments
 (0)