CB110 Intro to N1QL for SQL People


#1

Hello. I am performing a lab using cbimport on my Windows desktop. I am loading a large file with many documents in it. Instead of getting multiple documents inserted into my database, it appears that the same document is overwritten multiple times. Here is the command I am using:

cbimport json -c couchbase://mymachine -u Administrator -p password -b couchmusic2 -f lines -d file://couchmusic2-userprofiles.json -t 2 -g %type%::%username%
Json file://couchmusic2-userprofiles.json imported to http://mymachine:8091 successfully


#2

Hi @adrienne1,

I can’t recall the format of couchmusic2-userprofiles.json, but have you tried -f list or -f sample?


#3

Hi,

I have the same problem, did you solve this?

First I think it could be a problem with line delimitters, but I have change them with the same result of loading only 1 document.

Any help?

Thanks in advance


#4

If you are using Windows 10, you must escape % delimiters on the command line, using the ^ character, if the variable name referenced using those delimiters is also in use as a system variable name, such as username. Modify the command as:

cbimport json -c couchbase://127.0.0.1 -u Administrator -p password -b couchmusic2 -f lines -d file://couchmusic2-userprofiles.json -t 2 -g %type%::^%username^%

The training workbook has been updated to reflect this issue. Thank you for reporting it!


#5

That worked. Thanks!