MongoDB第四天(操作文档,添加,更新,查询以及对于日期的相关操作)
添加文档:
添加单个文档,多个文档
package com.bjsxt.mongodbdemo;
import com.mongodb.client.MongoCollection;
import org.bson.Document;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class InsertDocument {
MongoCollection collection = MongoDBPoolAuthUtil.getCollection("develop", "devtest");
public static void main(String[] args) {
InsertDocument insert=new InsertDocument();
//insert.insertSingleDocument();
insert.insertManyDocument();
}
/**
* 添加单个文档
*/
public void insertSingleDocument(){
Document document=new Document();
document.append("uname","lisi").append("age",25).append("userdesc","good").append("hobby", Arrays.asList(new String[]{"Music","Movie"}));
collection.insertOne(document);
}
/**
* 添加多个文档
*/
public void insertManyDocument(){
List<Document> documentList=new ArrayList<>();
for (int i=1;i<5;i++){
Document document=new Document();
document.append("uname","zs"+i);
document.append("age",25+i);
document.append("userdesc","prefect");
document.append("hobby", Arrays.asList(new String[]{"美女","Ballgame"}));
documentList.add(document);
}
collection.insertMany(documentList);
}
}
更新文档:
更新单个文档单个键,更新单个文档多个键,更新多个文档单个键,更新多个文档多个键,更新数组
package com.bjsxt.mongodbdemo;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.Filters;
import org.bson.Document;
public class UpdateDocument {
MongoCollection collection = MongoDBPoolAuthUtil.getCollection("develop", "devtest");
public static void main(String[] args) {
UpdateDocument update=new UpdateDocument();
//update.updateManyKeyDocument();
//update.updateManyDocumentSingleKey();
//update.updateManyDocumentManyKey();
// update.updateSingleDocumentArray();
update.updateManyDocumentArray();
}
/**
* 更新单个文档单个键
*/
public void updateSingleKeyDocument(){
collection.updateOne(Filters.eq("uname","lisi"),new Document("$set",new Document("age",28)));
}
/**
* 更新单个文档多个键
*/
public void updateManyKeyDocument(){
collection.updateOne(Filters.eq("uname","zs1"),new Document("$set",new Document("age",18).append("userdesc","very good")));
}
/**
* 更新多个文档单个键
*/
public void updateManyDocumentSingleKey(){
collection.updateMany(Filters.ne("uname",null),new Document("$set",new Document("userdesc","pretry good")));
}
/**
* 更新多个文档多个键
*/
public void updateManyDocumentManyKey(){
collection.updateMany(Filters.ne("uname",null),new Document("$set",new Document("userdesc","good").append("age",18)));
}
/**
* 更新单个文档的数组
*/
public void updateSingleDocumentArray(){
collection.updateMany(Filters.eq("uname","zs2"),new Document("$push",new Document("hobby","看小电影")));
}
/**
* 更新单个文档的多个数组
*/
public void updateManyDocumentArray(){
collection.updateMany(Filters.ne("uname",null),new Document("$push",new Document("hobby","欣赏小电影")));
}
}
查询文档:
查询全部文档,查询指定文档,查询多个文档(操作符)
package com.bjsxt.mongodbdemo;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import com.mongodb.client.model.Filters;
import org.bson.Document;
import org.bson.types.ObjectId;
import java.util.regex.Pattern;
public class SelectDocument {
MongoCollection collection = MongoDBPoolAuthUtil.getCollection("develop", "devtest");
public static void main(String[] args) {
SelectDocument select=new SelectDocument();
//select.selectAll();
//select.selectById();
//select.selectManytype();
/*select.selectManyin();*/
//select.selectManynin();
//select.selectManyregex();
//select.selectManyand();
//select.selectManyor();
//select.selectManyorand();
select.selectManysort();
}
/**
* 查询所有
*/
public void selectAll(){
FindIterable<Document> iterable = collection.find();
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 根据id查询
*/
public void selectById(){
FindIterable<Document> iterable = collection.find(Filters.eq("_id",new ObjectId("5dc0d6ca614f6b0a0c1915e3")));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询多个文档+gt
*/
public void selectManygt(){
FindIterable<Document> iterable = collection.find(Filters.gt("age",17));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询多个文档+type
*/
public void selectManytype(){
FindIterable<Document> iterable = collection.find(Filters.type("age","number"));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询多个文档+in
*/
public void selectManyin(){
FindIterable<Document> iterable = collection.find(Filters.in("uname","zs1","zs2","zs3"));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询多个文档+nin
*/
public void selectManynin(){
FindIterable<Document> iterable = collection.find(Filters.nin("uname","zs1","zs2","zs3"));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询多个文档以z开头2结尾
*/
public void selectManyregex(){
FindIterable<Document> iterable = collection.find(Filters.regex("uname", Pattern.compile("^z.*2$")));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询多个文档姓名是zs1,年龄是18
*/
public void selectManyand(){
FindIterable<Document> iterable = collection.find(Filters.and(Filters.eq("uname","zs1"),Filters.eq("age",18)));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询用户要求 uname 是 zs1,或者 age 是 18
*/
public void selectManyor(){
FindIterable<Document> iterable = collection.find(Filters.or(Filters.eq("uname","zs1"),Filters.eq("age",18)));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询文档中 uname 为 lisi 并且年龄为 18 岁,或者 userdesc 为 good
*/
public void selectManyorand(){
FindIterable<Document> iterable = collection.find(Filters.or(Filters.and(Filters.eq("uname","lisi"),Filters.eq("age",18)),Filters.eq("userdesc","good")));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
/**
* 查询文档中 username 是 z 开头的,根据 username 对结果做降序排序。1升序排序, -1 降序排序规则 $sort:{username,-1}
*/
public void selectManysort(){
FindIterable<Document> iterable = collection.find(Filters.regex("uname",Pattern.compile("^z"))).sort(new Document("uname",-1));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+doc.get("hobby"));
}
}
}
对于时间的操作
插入主机时间,插入指定时间,根据指定日期去查询数据(操作符:gt,eq,)
package com.bjsxt.mongodbdemo;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import com.mongodb.client.model.Filters;
import org.bson.Document;
import java.util.Date;
public class DateOperation {
MongoCollection collection = MongoDBPoolAuthUtil.getCollection("develop", "devtest");
public static void main(String[] args) {
DateOperation operation=new DateOperation();
//operation.insertDate();
//operation.insertCusDate();
//operation.SelectDate();
operation.SelectDategt();
}
/**
* 插入时间
*/
public void insertDate(){
Document doc=new Document();
doc.put("uname","ww");
doc.put("age",25);
doc.put("userdesc","very good");
doc.put("birth",new Date());
collection.insertOne(doc);
}
/**
* 插入指定日期
*/
public void insertCusDate(){
Date date=DateUtil.stringToDate("yyyy-MM-dd HH:mm:ss","2019-05-01 13:32:13");
Document doc=new Document();
doc.put("uname","zl");
doc.put("age",28);
doc.put("userdesc","very very good");
doc.put("birth",date);
collection.insertOne(doc);
}
/**
* 根据指定日期去查询数据
*/
public void SelectDate(){
Date date=DateUtil.stringToDate("yyyy-MM-dd hh:mm:ss","2019-05-01 13:32:13");
FindIterable iterable = collection.find(Filters.eq("birth", date));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
String birth = DateUtil.dateToString("yyyy-MM-dd hh:mm:ss", (Date) doc.get("birth"));
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+birth);
}
}
/**
* 根据指定日期去查询数据
*/
public void SelectDategt(){
Date date=DateUtil.stringToDate("yyyy-MM-dd hh:mm:ss","2019-01-01 00:00:00");
FindIterable iterable = collection.find(Filters.gt("birth", date));
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()){
Document doc = iterator.next();
String birth = DateUtil.dateToString("yyyy-MM-dd hh:mm:ss", (Date) doc.get("birth"));
System.out.println(doc.get("uname")+"\t"+doc.get("age")+"\t"+doc.get("userdesc")+"\t"+birth);
}
}
}
聚合操作(各种查询,操作符)
package com.bjsxt.mongodbdemo;
import com.mongodb.client.AggregateIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import org.bson.Document;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class AggregateOperation {
MongoCollection collection = MongoDBPoolAuthUtil.getCollection("develop", "devtest");
public static void main(String[] args) {
AggregateOperation operation = new AggregateOperation();
//operation.selectDocumentAggregateCount();
//operation.selectDocumentAggregateSum();
//operation.selectDocumentAggregateGroupBySum();
//operation.selectDocumentAggregateGroupByWhere();
//operation.selectDocumentAggregateGroupByHaving();
//operation.selectDocumentProject();
//operation.selectDocumentProjectConcat();
//operation.selectDocumentProjectAdd();
operation.selectDocumentProjectDate();
}
/**
* 查询集合中的文档数量
* MongoShell:db.dev.aggregate([{$group:{_id:null,count:{$sum:1}}
*/
public void selectDocumentAggregateCount() {
Document doc = new Document();
doc.put("$sum", 1);
Document count = new Document();
count.put("_id", null);
count.put("count", doc);
Document group = new Document();
group.put("$group", count);
List<Document> list = new ArrayList<>();
list.add(group);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document docu = iterator.next();
System.out.println(docu.get("count"));
}
}
/**
* 需求:查询集合中所有 age 键中的值的总和
* MongoShell:db.dev.aggregate([{$group:{_id:null,totalSize:{$sum:"$size"}}}])
*/
public void selectDocumentAggregateSum() {
Document document = new Document();
document.put("$sum", "$age");
Document sumage = new Document();
sumage.put("_id", null);
sumage.put("sumage", document);
Document group = new Document();
group.put("$group", sumage);
List<Document> list = new ArrayList<>();
list.add(group);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println("sum_age: " + doc.get("sumage"));
}
}
/**
* 需求:对 uname 进行分组,计算每组中的 age 的总和
* MongoShell:db.dev.aggregate([{$group:{_id:"$title",totalSize:{$sum:"$size"}}}])
*/
public void selectDocumentAggregateGroupBySum() {
Document document = new Document();
document.put("$sum", "$age");
Document sumage = new Document();
sumage.put("_id", "$uname");
sumage.put("sumage", document);
Document group = new Document();
group.put("$group", sumage);
List<Document> list = new ArrayList<>();
list.add(group);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc.get("_id") + "\t" + doc.get("sumage"));
}
}
/**
* 需求:查询 devtest 集合有多少文档的 age 大于 20。
* Mongo Shell:db.dev.aggregate([{$match:{size:{$gt:200}}},{$group:{_id:null,totalSize:{$sum:1}}}])
*/
public void selectDocumentAggregateGroupByWhere() {
Document match = new Document();
match.put("$match", new Document("age", new Document("$gt", 20)));
Document sumage = new Document();
sumage.put("$sum", 1);
Document two = new Document();
two.put("_id", null);
two.put("sumage", sumage);
Document group = new Document();
group.put("$group", two);
List<Document> list = new ArrayList<>();
list.add(match);
list.add(group);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc.get("sumage"));
}
}
/**
* 需求:查询 devtest 集合,根据 uname 分组计算出每组的 age 的总和,并过滤掉总和小于 20 的文档。
* Mongo Shell:db.dev.aggregate([{$group:{_id:"$title",totalSize:{$sum:"$size"}}},{$match:{totalSize:{$gt:200}}}])
*/
public void selectDocumentAggregateGroupByHaving() {
Document match = new Document();
match.put("$match", new Document("sumage", new Document("$gt", 20)));
Document sumage = new Document();
sumage.put("$sum", "$age");
Document two = new Document();
two.put("_id", "$uname");
two.put("sumage", sumage);
Document group = new Document();
group.put("$group", two);
List<Document> list = new ArrayList<>();
list.add(group);
list.add(match);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc.get("_id")+"\t"+doc.get("sumage"));
}
}
/**
* 需求:查询 devtest 集合,将数组中的内容拆分显示,并只显示 uname 键与 hobby键的值。
* Mongo Shell:db.dev.aggregate([{$unwind:"$tags"},{$project:{_id:0,tags:"$tags",title:"$title"}}])
*/
public void selectDocumentProject(){
Document unwind=new Document();
unwind.put("$unwind","$hobby");
Document show=new Document();
show.put("_id",0);
show.put("hobby","$hobby");
show.put("uname","$uname");
Document project=new Document();
project.put("$project",show);
List<Document> list=new ArrayList<>();
list.add(unwind);
list.add(project);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc);
}
}
/**
* 需求:查询 devtest 集合,将数组中的内容拆分显示。将 uname 字段和 hobby字段的值拼接为一个完整字符串并在 uname_hooby 字段中显示。
* Mongo Shell:db.dev.aggregate([{$unwind:"$tags"},{$project:{_id:0,Title_Tags:{$concat:["$title","-","$tags"]}}}])
*/
public void selectDocumentProjectConcat(){
Document unwind=new Document();
unwind.put("$unwind","$hobby");
Document concat=new Document();
concat.put("$concat", Arrays.asList(new String[]{"$uname","_","$hobby"}));
Document nh=new Document();
nh.put("_id",0);
nh.put("uname_hooby",concat);
Document project=new Document();
project.put("$project",nh);
List<Document> list=new ArrayList<>();
list.add(unwind);
list.add(project);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc);
}
}
/**
* 需求:查询 devtest 集合中数据,显示 uname 和 age 字段,为 age 字段数据做加 1 操作,显示字段命名为 age。排除那些没有 age 键的文档。
* Mongo Shell:db.dev.aggregate([{$match:{size:{$ne:null}}},{$project:{_id:0,title:1,New_Size:{$add:["$size",1]}}}])
*/
public void selectDocumentProjectAdd(){
Document ne =new Document();
ne.put("$ne",null);
Document age=new Document();
age.put("age",ne);
Document match=new Document();
match.put("$match",age);
Document add=new Document();
add.put("$add",Arrays.asList(new Object[]{"$age",1}));
Document show =new Document();
show.put("_id",0);
show.put("uname",1);
show.put("age",add);
Document project =new Document();
project.put("$project",show);
List<Document> list=new ArrayList<>();
list.add(match);
list.add(project);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc);
}
}
/**
* 需求:查询 devtest 集合查询那些有生日的用户,并按照 YYYY 年 mm 月dd 日 HH:MM:SS 格式显示日期。
* 注意:如果直接在 MongoDB 中做日期的格式化处理,那么是按照表示 UTC时间来处理的,会少 8 个小时。建议在程序中
* 通过 java.util.Date 来做日期的转换。
* Mongo Shell:db.devtest.aggregate([{$match:{userbirth:{$ne:null}}},{$project:{自定义日期格式:{$dateToString:{format:"%Y 年%m 月%d日 %H:%M:%S",date:"$userbirth"}}}}])
*/
public void selectDocumentProjectDate(){
Document ne =new Document();
ne.put("$ne",null);
Document birth=new Document();
birth.put("birth",ne);
Document match=new Document();
match.put("$match",birth);
//{$project:{自定义日期格式:{$dateToString:{format:"%Y 年%m 月%d日 %H:%M:%S",date:"$userbirth"}}}}
Document format=new Document();
format.put("format","%Y 年%m 月%d日 %H:%M:%S");
format.put("date","$birth");
Document dateToString=new Document();
dateToString.put("$dateToString",format);
Document zdy=new Document();
zdy.put("自定义日期格式",dateToString);
Document project=new Document();
project.put("$project",zdy);
List<Document> list=new ArrayList<>();
list.add(match);
list.add(project);
AggregateIterable iterable = collection.aggregate(list);
MongoCursor<Document> iterator = iterable.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
System.out.println(doc);
}
}
}
日期的转化工具类
package com.bjsxt.mongodbdemo;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateUtil {
/**
* date to string
*/
public static String dateToString(String pattern, Date date){
SimpleDateFormat spdf=new SimpleDateFormat(pattern);
String format = spdf.format(date);
return format;
}
/**
* String to date
*/
public static Date stringToDate(String pattern, String date){
SimpleDateFormat spdf=new SimpleDateFormat(pattern);
try {
Date parse = spdf.parse(date);
return parse;
}catch (Exception e){
e.printStackTrace();
}
return null;
}
}
俩种分页操作
package com.bjsxt.mongodbdemo;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import org.bson.Document;
import org.bson.types.ObjectId;
public class SelectDocumentByPage {
MongoCollection collection = MongoDBPoolAuthUtil.getCollection("develop", "devtest");
public static void main(String[] args) {
SelectDocumentByPage docd=new SelectDocumentByPage();
//docd.selectDocumentByPageUseSkipAndLimit(3);
docd.selectDocumentByPageUseCondition(2,2,"5dc0d85c614f6b2730c1d0fd");
}
/**
* 实现分页查询
*/
public void selectDocumentByPageUseSkipAndLimit(int pageIndex){
int page=(pageIndex-1)*2;
Document doc=new Document("age",new Document("$ne",null));
long count = collection.countDocuments(doc);
System.out.println(count);
FindIterable ite = collection.find(doc).limit(2).skip(page);
MongoCursor<Document> iterator = ite.iterator();
while (iterator.hasNext()){
Document docu = iterator.next();
System.out.println(docu);
}
}
/**
* 条件判断实现分页
*/
public void selectDocumentByPageUseCondition(int pageIndex,int pageSize,String lastId){
Document doc=new Document("age",new Document("$ne",null));
long count = collection.countDocuments(doc);
System.out.println(count);
FindIterable ite =null;
if (pageIndex==1){
ite = collection.find(doc).limit(pageSize);
}else {
if (lastId!=null){
doc.append("_id",new Document("$gt",new ObjectId(lastId)));
ite = collection.find(doc).limit(pageSize);
}
}
MongoCursor<Document> iterator = ite.iterator();
while (iterator.hasNext()){
Document docu = iterator.next();
System.out.println(docu);
}
}
}
MongoDB第四天(操作文档,添加,更新,查询以及对于日期的相关操作)的更多相关文章
- MongoDB(五):MongoDB操作文档
本篇文章中将讲解如何使用MongoDB操作文档. 文档的数据结构和JSON基本一致,所有存储在集合中的数据都是BSON格式.BSON是一种类似json格式的一种二进制形式的存储格式,简称Binary ...
- ElasticSearch使用C#操作文档
一.ElasticSearch的.net客户端驱动程序 ElasticSearch官方网站提供了两个.net客户端驱动程序,其中Elasticsearch.Net是一个非常底层且灵活的客户端驱动程序, ...
- lua的io操作文档
2014-09-16~15:26:35 I/O库提供两种不同的方式进行文件处理1.io表调用方式:使用io表,io.open将返回指定文件的描述,并且所有的操作将围绕这个文件描述 io表同样提供三种预 ...
- [转载]MongoDB学习 (四):创建、读取、更新、删除(CRUD)快速入门
本文介绍数据库的4个基本操作:创建.读取.更新和删除(CRUD). 接下来的数据库操作演示,我们使用MongoDB自带简洁但功能强大的JavaScript shell,MongoDB shell是一个 ...
- mongodb(四):对文档操作增删查改(python)
连接mongodb #!/usr/bin/env python # -*- coding:utf-8 -*- import pymongo mongo_client = pymongo.MongoCl ...
- 从域名到网站,快速创建全新社区站点 - phpwind一键部署操作文档
关于phpwind一键部署服务,请查阅PW官网:http://www.phpwind.com/setup.html 选择一键部署镜像版本,立即开始使用: PW建站系统(Centos 64位) ———— ...
- IDEA使用操作文档
IDEA中怎么设置黑色或白色背景? http://jingyan.baidu.com/article/4e5b3e19330df191911e246b.html 一. IntelliJ IDEA 的 ...
- Linux常用命令操作文档
Ls命令:列出目录内容 选项 长选项 含义 -a --all 列出所有文件,包括隐藏的文件 -d --directory 指定一个目录 -F --classify 在每个列出的名字后面加上类型指示符( ...
- ElasticSearch 基础入门 and 操作索引 and 操作文档
基本概念 索引: 类似于MySQL的表.索引的结构为全文搜索作准备,不存储原始的数据. 索引可以做分布式.每一个索引有一个或者多个分片 shard.每一个分片可以有多个副本 replica. 文档: ...
随机推荐
- 【Elasticsearch 7 探索之路】(二)文档的 CRUD 和批量操作
上一篇,我们介绍了什么是 Elasticsearch,它能做什么用以及基本概念(索引 Index.文档 Document.类型 Type)理解.这篇主要对 文档的基本 CRUD 和 倒排索引进行讲解. ...
- 简单搭建syslog-ng server记录log
### 简单搭建syslog-ng server记录log 安装syslog-ng apt-get install syslog-ng 安装syslog-ng 配置syslog-ng vim /etc ...
- WIN7安装Docker Toolbox、制作镜像并发到阿里云
一.安装Docker Toolbox,并配置国内源加速 WIndows7不支持Hyper-v,所以只能采用Docker Toolbox的方式使用Docker.传送门:http://mirrors.al ...
- C# web项目中sql数据库转sqlite数据库
最近做了一个小网站,用到了一个使用sql server 2005的.net cms系统,但是现在我所买虚拟主机的服务商,不给虚拟主机提供sql server服务了,那就转数据库吧,转啥好呢,思来想去, ...
- Look into Bitmap images
What's a Bitmap image? I'm not going to explain the differences between raster and vector images, no ...
- nyoj 19-擅长排列的小明(STL-next_permutation())
19-擅长排列的小明 内存限制:64MB 时间限制:1000ms Special Judge: No accepted:10 submit:16 题目描述: 小明十分聪明,而且十分擅长排列计算.比如给 ...
- AE10.0在Visual Studio 2012下安装没有模板(转)
转自百度经验: VS2012中丢失ArcGIS模板的解决方法 由于ArcGIS10.0(for .NET)默认是用VS2010作为开发工具的,所以在先安装VS2012后装ArcGIS10.0 桌面版及 ...
- webpack-dev-middleware 和 webpack-hot-middleware 配置开发环境和生产环境;webpack脚手架;仿vue-cli
webpack-dev-server更新后自带express服务器,已经不需要自己搭建.vue-cli从17年底左右也换成了最新的webpack-dev-server,而不是用webpack-dev- ...
- 2019-11-7:sql注入防御,webshell概念,学习笔记
sql注入防护GPC,magic_quotes_gpc函数在php中的作用是判断解析用户提示的数据,如包括有:post.get.cookie过来的数据增加转义字符“\”,以确保这些数据不会引起程序,特 ...
- 2019-9-20:渗透测试,基础学习,phpstudy搭建Wordpress,Burpsuite抓取WorePress cms的post包
一.搭建WordPress的cms网站管理系统 1,下载Wordpress cms源码,下载地址:https://wordpress.org/download/ 2,将源码解压到phpstudy目录下 ...