Hi,
I am using could search domain service in nodejs. While I am trying to upload a json object its showing
[InvalidParameterType: Expected params.documents to be a string, Buffer, Stream, Blob, or typed array object]
my function looks like,
`var doc = { "type": "add",
"id": "tt0484562",
"fields": {
"title": "The Seeker: The Dark Is Rising",
"directors": ["Cunningham, David L."],
"genres": ["Adventure","Drama","Fantasy","Thriller"],
"actors": ["McShane, Ian","Eccleston, Christopher","Conroy, Frances",
"Crewson, Wendy","Ludwig, Alexander","Cosmo, James",
"Warner, Amelia","Hickey, John Benjamin","Piddock, Jim",
"Lockhart, Emma"]
}
}
var params = {
contentType: 'application/json',
documents: doc /* required */
};
csd.uploadDocuments(params, function(err, data) {
console.log(err);
if (!err) done(null,data); // successful response
});`
Please mention the exact format for params.documents
Fixed. I have used JSON.stringify(doc).
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
Fixed. I have used JSON.stringify(doc).