企业AI知识库

轻易云AI知识库是一个为企业量身打造的智能解决方案,它能够进行机器人角色设定、知识库训练、发布/分享机器人,同时还带有AI智能对话功能,可以设定多种AI行业场景。适用于企业智能客服、企业智能文档、专家顾问助理等多种企业级商业场景,具有较大的商业使用价值。

了解更多,请访问轻企AI知识库官网

AI智能体

AI智能体是轻易云知识库的核心组成部分,它通过录入文档或问答来创建知识库,让机器人学习。根据机器人训练情况,企业可以实时删除或替换文档,以保持知识库的更新和准确性。AI智能体支持多种角色设定,如客服、销售、培训师、营销人员、行业专家等,以满足不同业务需求。

了解更多,请访问轻易云知识库体验中心

MongoDB写法介绍

简单介绍

MongoDB是一个基于分布式文件存储的数据库
由C++语言编写,旨在为WEB应用提供可扩展的高性能数据存储解决方案。
MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。
它支持的数据结构非常松散,是类似json的bson格式,因此可以存储比较复杂的数据类型。
Mongo最大的特点是它支持的查询语言非常强大,其语法有点类似于面向对象的查询语言,几乎可以实现类似关系数据库单表查询的绝大部分功能,而且还支持对数据建立索引

查询方法

查询所有

MongoDB	db.getCollection('user').find({});	 
MySQL	select * from user;	 

查询条件:=

MongoDB	db.getCollection('user').find({"uclass":"A"});	 
MySQL	select * from user where uclass = 'A';	
``` 
查询条件:like	
```json
MongoDB	db.getCollection('user').find({"name":/Ba/});	 
MySQL	select * from user where name like '%Ba%';	 

查询条件:distinct

MongoDB	db.getCollection('user').distinct("name");	 
MySQL	select distinct uclass from user u;	 

查询条件:$gt

MongoDB	db.getCollection('user').find({"age":{$gt:16}});	greater than  >
MySQL	select * from user where age >16;	 

查询条件:$gte

MongoDB	db.getCollection('user').find({"age":{$gte:16}});	gt equal  >=
MySQL	select * from user where age >= 16;	
``` 
查询条件:$lt	
```josn
MongoDB	db.getCollection('user').find({"age":{$lt:16}});	less than  <
MySQL	select * from user where age < 16;	 

查询条件:$lte

MongoDB	db.getCollection('user').find({"age":{$lte:16}});	lt equal  <=
MySQL	select * from user where age <= 16;	 

查询条件:$ne

MongoDB	db.getCollection('user').find({"age":{$ne:16}});	not equal  !=
MySQL	select * from user where age != 16;	
``` 
查询条件:$eq	
```josn
MongoDB	db.getCollection('user').find({"age":{$eq:16}});等效于:db.getCollection('user').find({"age":16});	
MySQL	select * from user where age = 16;	 

查询条件:in

MongoDB	db.getCollection('user').find({"uclass":{$in:['A', 'B']}});	 
MySQL	select * from user where uclass in ('A', 'B');	
``` 
查询条件:and	
```josn
MongoDB	db.getCollection('user').find({"uclass":"B", "age":{$gt:16}});	 
MySQL	select * from user where uclass = 'B' and age > 16;
```	 
查询条件:or	
```josn
MongoDB	db.getCollection('user').find({$or:[{"uclass":"A"},{"class":"B"}]});	 
MySQL	select * from user where uclass = 'A' or  uclass = 'B';	 

查询条件:时间

MongoDB	db.getCollection('user').find({"birthday":{$gt: new Date("2008-08-14T06:24:40.110Z"), $lt: new Date("2015-08-14T06:14:40.089Z")}});	 
MySQL	select * from user where birthday > '2008-08-14 06:24:40' and birthday < '2015-08-14 06:14:40';
```	 
查询条数:count	
```josn
MongoDB	db.getCollection('user').find({"uclass":"A"}).count();	 
MySQL	select count(1) from user where uclass = 'A';	 

查询条件:sort升序

MongoDB	db.getCollection('user').find({}).sort({"age":1});	 
MySQL	select * from user order by age asc;	 

查询条件:sort降序

MongoDB	db.getCollection('user').find({}).sort({"age":-1});	 
MySQL	select * from user order by age desc;	 

聚合查询:count单列

MongoDB	db.getCollection('user').aggregate([{$group:{_id:"$uclass",num:{$sum:1}}}]);	 
MySQL	select uclass, count(1) as num from user group by uclass;	 

聚合查询:count多列

MongoDB	db.getCollection('user').aggregate([{$group:{_id:{uclass:"$uclass", age:"$age"},num:{$sum:1}}}]);	 
MySQL	select uclass, age, count(1) as num from user group by uclass, age;
```	 
分页查询:limit n	
```josn
MongoDB	db.getCollection('user').find({}).limit(5);	查询前n条
MySQL	select * from user limit 5;	 

分页查询:limit m,n

MongoDB	db.getCollection('user').find({}).limit(5).skip(5);	查询n条,从第m条开始
MySQL	select * from user limit 5,5;	 

查询指定字段

MongoDB	db.getCollection('user').find({}, {userId:1, name:1});	第一个{}为查询条件
MySQL	select userId, name from user;
```	 
排查指定字段	
```josn
MongoDB	db.getCollection('user').find({}, {dataStatus:0, _id:0});	第一个{}为查询条件
MySQL	无

还没写完

热门文章

调用金蝶云星辰V2接口进行商品数据增量同步方法详解

2023-04-25 15:52:21

详细解析金蝶云星空与百胜ME3数据对接流程

2023-05-28 23:03:39

数据转换与数据库写入:金蝶云星空数据集成到MySQL实战

2021-01-09 19:58:20

聚水潭数据获取与实时写入小满OKKICRM的详细流程

2023-03-05 11:19:41

调用泛微OA-Http接口获取程序化数据:技术解析

2021-02-14 01:20:40

调用金蝶云星空接口实现销售退货单数据处理全流程

2021-03-15 20:15:46

使用轻易云调用致远A8+接口获取并加工数据的完整流程

2023-07-13 17:00:09

销售出库单数据高效传输与处理方法

2022-09-15 21:06:35

从吉客云获取并转换数据到班牛系统的技术详解

2023-11-06 21:39:08

从钉钉获取部门数据:调用接口与数据加工

2021-03-04 20:54:31

executeBillQuery接口调用详解及数据加工方法

2023-05-02 22:13:33

通过轻易云平台实现金蝶云星空市地区信息查询与处理

2023-12-23 01:59:55

利用轻易云实现金蝶银行账号数据的无缝对接技术

2021-04-02 09:01:16

如何配置用友BIP接口及实现高效数据转换

2022-11-12 03:19:28

调用金蝶云星空API获取和处理收款单数据的详细指南

2023-06-23 02:01:17

金蝶云星空接口调用与数据处理:从executeBillQuery到数据加工

2021-12-12 20:11:05

如何调用吉客云接口实现实时数据同步

2022-07-02 02:32:44

利用轻易云调用班牛API接口并处理退换货数据

2022-09-21 10:57:23

深入了解executeBillQuery接口:通过轻易云集成销售退货单数据

2021-03-19 12:12:19

轻易云平台实现有赞店铺数据获取与处理技术指南

2022-10-07 11:07:36

汤臣倍健营销云和畅捷通T+接口打通对接实战

2023-01-26 09:58:16

从四化智造MES(WEB)到金蝶云星空通过接口集成数据

2023-01-26 09:58:15

金蝶云星空、四化智造MES(API)通过接口配置数据对接

2023-01-26 09:58:14

管易云、金蝶云星空通过接口配置数据对接

2023-01-26 09:58:13

接口配置打通轻易云集成平台和金蝶云星空数据对接

2023-01-26 09:58:12