Azure-docs: Type Issue on the Insert Function

Created on 1 Feb 2020  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

When inserting the data, there is a type error:

> There was an error Cannot read property 'type' of undefined TypeError: Cannot read property 'type' of undefined
at getParamType (C:\Users\miubezzi\projects\git-samplesazure-cosmos-db-cassandra-nodejs-getting-started\node_modulescassandra-driver\librequests.js:328:50)...

This is due to a mismatch in the number of args in the query and the parameters:

query: 'INSERT INTO  uprofile.user  (user_id, user_name , user_bcity) VALUES (?,?,?)',
params: [1, 'LyubovK', 'Dubai', '2017-10-3132']

The fix is to add a timestamp argument to the query or remove the timestamp for the params.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author cosmos-dsvc cosmosdb-cassandrsubsvc product-issue triaged

All 9 comments

@skyarkitekten Thank you for taking the time to file this issue and detail the root cause. I will have the content author review this, as well as make the repository contributors aware of this issue. @kanshiG @zanasrin @mimig1 @kansrini @cmcclister for awareness.

Thanks Chad.

We will now close this issue.

please-close

@Mike-Ubezzi-MSFT can you please reopen this issue?

@TheovanKraay said the above PR doesn't completely fix the issue.

Logged batches are not supported by the service - so when you remove the type error, you get another error. However, I have simplified the linked GitHub sample (see: https://github.com/Azure-Samples/azure-cosmos-db-cassandra-nodejs-getting-started/pull/4), which stops the error from happening in the Quickstart. For completeness I should do another small doc change in the main doc to reflect that sample's code.

Reopening this issue to address issue still persisting.

@TheovanKraay Did you finish the doc update? please comment if this issue is ready to close.

Yes this can be closed.

@skyarkitekten We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bityob picture bityob  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

jebeld17 picture jebeld17  Â·  3Comments

bdcoder2 picture bdcoder2  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments