From 4528a96ded3f2023d193957a95ffbd070e4cfc30 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 22 Apr 2021 23:29:06 +0200 Subject: prepare npm publish --- src/test/rethink_test.ts.disabled | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/test/rethink_test.ts.disabled (limited to 'src/test/rethink_test.ts.disabled') diff --git a/src/test/rethink_test.ts.disabled b/src/test/rethink_test.ts.disabled new file mode 100644 index 00000000..d1470515 --- /dev/null +++ b/src/test/rethink_test.ts.disabled @@ -0,0 +1,34 @@ +import { r } from "rethinkdb-ts"; + +async function main() { + const connection = await r.connect({ port: 28015 }); + + const db = r.db("test"); + const cursor = await db + .table("guilds") + .get(0) + .changes({ squash: true }) + .map(function (row) { + return row("old_val") + .keys() + .setUnion(row("new_val").keys()) + .concatMap(function (key) { + return r.branch( + row("old_val")(key).ne(row("new_val")(key)).default(true), + [[key, row("new_val")(key).default(null)]], + [] + ); + }) + .coerceTo("object"); + }) + .run(connection); + + console.log("each"); + cursor.each(function (err, row) { + if (err) throw err; + console.log(row); + }); + console.log("eachend"); +} + +main(); -- cgit 1.5.1