mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
Merge pull request #7426 from maouida/master
Updated couchbase definition to work with the latest node.js sdk 2.1.2
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
/// <reference path="couchbase.d.ts"/>
|
||||
|
||||
import couchbase = require('couchbase');
|
||||
var db = new couchbase.Connection({ bucket: "default" }, function (err) {
|
||||
if (err) throw err;
|
||||
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
|
||||
var bucket = cluster.openBucket('default');
|
||||
|
||||
// TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix
|
||||
(<couchbase.Connection>db).set('testdoc', { name: 'Frank' }, function (err, result) {
|
||||
if (err) throw err;
|
||||
bucket.upsert('testdoc', { name: 'Frank' }, (error) => {
|
||||
if (error) throw error;
|
||||
|
||||
var s: string = err.message;
|
||||
bucket.get('testdoc', (err, result) => {
|
||||
if (err) throw err;
|
||||
|
||||
// TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix
|
||||
(<couchbase.Connection>db).get('testdoc', function (err, result) {
|
||||
if (err) throw err;
|
||||
|
||||
console.log(result.value);
|
||||
// {name: Frank}
|
||||
});
|
||||
console.log(result.value);
|
||||
// {name: Frank}
|
||||
});
|
||||
});
|
||||
1568
couchbase/couchbase.d.ts
vendored
1568
couchbase/couchbase.d.ts
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user