This resource is a complete list for all videos and documentation I have found helpful for JavaScript developers working with Couchbase Server. Others are resources I have created on my own to try and bridge the gap, update or add value to existing resources.
- pull the official image:
docker pull mongo
optionally pull by version:
docker pull mongo:4.2.3
- pull the official image:
docker pull mongo
optionally pull by version:
docker pull mongo:4.2.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() | |
const { user, pass } = process.env | |
const fs = require('fs') | |
const couchbase = require('couchbase'); | |
const cluster = new couchbase.Cluster('couchbase://localhost', { username: user, password: pass }) | |
const bucket = cluster.bucket('events') | |
let statement = "SELECT * FROM `events` WHERE category='JavaScript' AND type='event'" | |
new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() | |
const { user, pass } = process.env | |
const couchbase = require('couchbase'); | |
const cluster = new couchbase.Cluster('couchbase://localhost',{username: user, password: pass}) | |
const bucket = cluster.bucket('events') | |
let statement = "CREATE INDEX adv_category_type ON `events`(`category`) WHERE `type` = 'event'" | |
new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() | |
const { user, pass } = process.env | |
const couchbase = require('couchbase'); | |
const cluster = new couchbase.Cluster('couchbase://localhost',{username: user, password: pass}) | |
const bucket = cluster.bucket('events') | |
let statement = "CREATE PRIMARY INDEX ON `events`" | |
new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() | |
const { user, pass } = process.env | |
const faker = require('faker') | |
const couchbase = require('couchbase') | |
const cluster = new couchbase.Cluster('couchbase://localhost', { username: user, password: pass }) | |
const bucket = cluster.bucket('events') | |
const collection = bucket.defaultCollection() | |
/* |
-
docker pull couchbase
-
git clone https://github.com/httpJunkie/couchbase-server-lt && cd couchbase-server-lt && chmod +x configure.sh
-
docker build -t couchbase-server-lt .
-
docker run -d -p 8091-8094:8091-8094 -p 11210:11210 -e CB_ADMIN_USER=Administrator -e CB_ADMIN_PASS=password -e CB_BUCKET=conference-data -e CB_BUCKET_PASS= --name cbs1 couchbase-server-lt
At this point, we can visit localhost:8091 and login with Administrator
and password
.
We should have 1 server, 1 node, 1 bucket named conference-data
!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const graphqlHTTP = require('express-graphql') | |
const { buildSchema } = require('graphql') | |
const couchbase = require('couchbase') | |
const pjson = require('./package.json') | |
const cbMajorVersion = Number(pjson.dependencies.couchbase.match(/\d/)) | |
const app = express() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ApolloClient from 'apollo-boost' | |
import { ApolloProvider } from '@apollo/react-hooks' | |
const withApolloProvider = (WrappedComponent, graphqlEndpoint) => { | |
const apolloClient = new ApolloClient({ | |
uri: graphqlEndpoint, | |
}) | |
return (props) => ( |