企业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	无

还没写完

热门文章

调用聚水潭API接口并进行数据转换与写入MySQL

2022-07-27 16:04:02

详细解析吉客云销售出库红字到金蝶云销售退的数据处理步骤

2021-04-14 15:20:06

技术解析:从易仓到金蝶云星空的全自动数据抓取与写入

2022-08-25 22:25:47

深入解析马帮ebay草稿箱数据集成到MySQL的技术细节

2021-01-18 22:55:33

汤臣倍健营销云数据接口调用及初步加工指南

2021-05-18 02:07:11

实现高效数据流动:旺店通与金蝶云星空的集成方案解析

2024-11-07 11:10:29

如何高效调用金蝶云星空API获取并处理数据

2021-12-22 19:04:39

数据集成实战:轻易云平台上的MySQL物料信息管理

2021-08-05 19:05:51

调用金蝶云星空接口获取采购入库数据的详细方法

2021-12-01 16:12:43

轻松获取与处理金蝶云星空数据:使用executeBillQuery接口

2024-03-19 20:20:37

使用executeBillQuery接口获取金蝶云星空数据的最佳实践

2022-03-31 09:54:06

调用金蝶云星空接口executeBillQuery进行数据获取与处理

2021-09-29 14:37:45

企业数据流转:钉钉到金蝶付款单的实践案例

2024-10-26 13:50:57

API调用与数据清洗:集成马帮出入库数据到MySQL

2021-07-09 02:52:17

使用轻易云平台配置金蝶采购入库查询API:实例详解

2024-01-09 05:30:41

轻易云平台实现高效亚马逊店铺数据抓取

2024-06-11 02:28:26

调用executeBillQuery接口获取并加工供应商数据的技术详解

2021-08-29 00:01:42

如何通过API接口实现KIS供应商数据的高效获取与加工

2024-07-26 15:06:39

如何调用金蝶云星辰V2API实现客户数据获取

2024-01-04 04:27:47

轻易云平台助力聚水潭·奇门与畅捷通T+数据对接

2024-11-09 07:09:25

ERP与MES系统深度对接详细解决方案

2024-03-30 03:49:46

企业系统对接必知事项-请您查收

2024-03-29 02:48:18

为什么企业一定要做电商系统对接?

2024-03-27 10:34:37

企业多套系统集成应该规划哪些数据到财务系统?

2024-03-27 07:26:56

客户案例:吉客云对接金蝶云星空

2024-03-26 10:52:35