#community-help

Issues with Document Import in Database Collection

TLDR Raj stated that a document import example for database collection does not seem to work, and Jason looped in Kishore Nallan for further assistance.

Powered by Struct AI
Jan 30, 2023 (10 months ago)
Raj
Photo of md5-e9c07b29ef6c5b55418c3084662f0a5a
Raj
05:23 PM
ImportDocumentsParameters queryParameters = new ImportDocumentsParameters();
queryParameters.action("create");

String documentList = "{\"countryName\": \"India\", \"capital\": \"Washington\", \"gdp\": 5215}\n" +
                      "{\"countryName\": \"Iran\", \"capital\": \"London\", \"gdp\": 5215}";
// Import your document as JSONL string from a file.
client.collections("countries").documents().import_(documentList, queryParameters)

this example does not seems to be adding the collection
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:08 PM
CC: Kishore Nallan