|
@@ -2,7 +2,7 @@ const { CloudQuery, CloudObject } = require("../lib/ncloud");
|
|
|
// testCRUD()
|
|
|
testQuery()
|
|
|
async function testQuery(){
|
|
|
- let query = new CloudQuery("Doctor")
|
|
|
+ let query = new CloudQuery("ChatPartner")
|
|
|
// query.equalTo("gender","女")
|
|
|
query.greaterThanAndEqualTo("age",40)
|
|
|
query.lessThan("age",41)
|
|
@@ -12,16 +12,16 @@ async function testQuery(){
|
|
|
|
|
|
async function testCRUD(){
|
|
|
// 基本的增删查改测试
|
|
|
- let query = new CloudQuery("Doctor")
|
|
|
- let doctorList = await query.find();
|
|
|
- console.log("doctorList count",doctorList?.length)
|
|
|
+ let query = new CloudQuery("ChatPartner")
|
|
|
+ let chatpartnerList = await query.find();
|
|
|
+ console.log("chatpartnerList count",chatpartnerList?.length)
|
|
|
|
|
|
- let newDoctor = new CloudObject("Doctor")
|
|
|
- newDoctor.set({"name":"123"})
|
|
|
+ let newChatPartner = new CloudObject("ChatPartner")
|
|
|
+ newChatPartner.set({"name":"123"})
|
|
|
|
|
|
- newDoctor = await newDoctor.save(newDoctor)
|
|
|
- console.log("newDoctor",newDoctor)
|
|
|
+ newChatPartner = await newChatPartner.save(newChatPartner)
|
|
|
+ console.log("newChatPartner",newChatPartner)
|
|
|
|
|
|
- await newDoctor.destory()
|
|
|
- console.log("newDoctor 已删除",newDoctor)
|
|
|
+ await newChatPartner.destory()
|
|
|
+ console.log("newChatPartner 已删除",newChatPartner)
|
|
|
}
|