From 8280aeb4d51e71dcc1daf668ad6a9ed11030fe11 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Sat, 17 Oct 2020 18:15:05 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E7=AE=80=E5=8C=96clientDB=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/uniCloud/uni-clientDB.md | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/docs/uniCloud/uni-clientDB.md b/docs/uniCloud/uni-clientDB.md index b4f17abcae..f6bc1f2ba7 100644 --- a/docs/uniCloud/uni-clientDB.md +++ b/docs/uniCloud/uni-clientDB.md @@ -107,15 +107,9 @@ import db from '@/js_sdk/uni-clientDB/index.js' const dbCmd = db.command // 使用uni-clientDB -db.action('get-info') // 不使用action时可以不调用action方法 - .collection('list') +db.collection('list') .where({ - name: new RegExp('龚','g'), - time: dbCmd.gt(1105885393581) - }).field({ - name: true, - time: true, - content: true + name: "hello-uni-app" }).get() .then((res)=>{ // res 为数据库查询结果 @@ -155,14 +149,9 @@ import db from '@/js_sdk/uni-clientDB/index.js' const dbCmd = db.command // 上面的示例中的where条件可以使用以下写法 -db.action('get-info') // 不使用action时可以不调用action方法 - .collection('list') - .where('/龚/g.test(name) && time > 1105885393581') - .field({ - name: true, - time: true, - content: true - }).get() +db.collection('list') + .where('name == "hello-uni-app"') + .get() .then((res)=>{ // res 为数据库查询结果 }).catch((err)=>{ -- GitLab