docker-compose up -d
docker exec -it mo-couchbase bash
cd scripts
then ./setup-couchbase.sh
, type y
if prompted. See details belowlocalhost:8091
and login using admin:password
localhost:8881
This script will initialize and setup couchbase node and cluster using the couchbase-cli, hence, no manual setup is required. It will:
admin:password
credentialsdata, index, query, fts
services enableduser:password
with full admin
rightstestBucket
developer-preview
to enable scope and collections
featuretestScope
under testBucket
testCollection
under testScope
Note: Step 5-7 is disabled currently due to issue connecting to couchbase with scope and collections enabled
Once the above is setup, run npm test
to ensure current test pass
Note: May need to run the command twice to get test pass for the very first run. Not sure the cause of it yet
You can now write test cases to verify the behavior of mongoose and ottoman
/test
directoryTest cases that are indicated with .skip
are either
Create Bucket:
/opt/couchbase/bin/couchbase-cli bucket-create --cluster localhost:8091 --username admin --password password --bucket testBucket --bucket-type couchbase --bucket-ramsize 100
Grab buckets stats:
/opt/couchbase/bin/cbstats -u admin -p password localhost:11210 -b testBucket all | grep collections
/opt/couchbase/bin/cbstats -u admin -p password localhost:11210 -b testBucket all | grep scopes
To create scope:
/opt/couchbase/bin/couchbase-cli collection-manage --cluster http://localhost:8091 --username admin --password password --bucket testBucket --create-scope testScope
To list scopes:
/opt/couchbase/bin/couchbase-cli collection-manage --cluster http://localhost:8091 --username admin --password password --bucket testBucket --list-scopes
To create collection:
/opt/couchbase/bin/couchbase-cli collection-manage --cluster http://localhost:8091 --username admin --password password --bucket testBucket --create-collection testScope.testCollection
To list collections:
/opt/couchbase/bin/couchbase-cli collection-manage --cluster http://localhost:8091 --username admin --password password --bucket testBucket --list-collections testScope
/opt/couchbase/bin/cbstats -u admin -p password -b testBucket localhost:11210 collections
/opt/couchbase/bin/cbstats -u admin -p password -b testBucket localhost:11210 collections-details