技术教程 第95页

MongoDB 常用shell整理 四

1、根据username修改age >db.employee.update({username:'jim'},{$set:{age:22}},false,true); db.collection.update(criteria,objNew,upsert,multi) criteria:update的查询条件,类似sqlupdate...
赞 (0)

MongoDB 常用shell整理 三

1、查询age列数据,并去掉重复数据 >db.mycollection.distinct('age'); 2、查询前10条数据 >db.mycollection.find().limit(10); 3、查询1条以后的所有数据 >db.mycollection.find().skip(1); 4、查询第一条数据 >d...
赞 (0)

MongoDB 常用shell整理 二

1、插入数据 >db.mycollection.insert({'username':'xyz_lmn','age':26,'salary':120}); 往'mycollection'聚集集合中插上一条数库,name为'xyz_lmn&apo...
赞 (0)

MongoDB 常用shell整理 一

shell命令操作语法和JavaScript很类似,其实控制台底层的查询语句都是用JavaScript脚本完成操作的。使用shell 命令,需要启动mongo.exe。 常用shell命令如下: 1、查询本地所有数据库名称 > show dbs; 2、切换至指定数据库环境(若无指定的数据库,则创建新的库) > use mydb; 3、查询当前库下...
赞 (0)

suspicious cache-id, must contain _cv_ to be cached 解决办法

报错信息”suspicious cache-id, must contain _cv_ to be cached”,通常见于phpize执行后,出现这种提示是因为autoconf的版本太高了,解决办法也很简单: 1.卸载本机的autoconf 2.执行如下指令安装低版本的autoconf wget https://ftp.gnu.or...
赞 (0)

CentOS 列出app可安装版本

有些程序需要安装旧版的时候,如何查看源包含的程序的版本? 以httpd为例: yum --showduplicates list httpd | expand 输出结果: Loaded plugins: fastestmirror, langpacks, refresh-packagekitLoading mirror speeds from cached ...
赞 (0)

Linux Shell 进程守护脚本

有时候需要进程守护,确保进程稳定运行,这个时候一个shell是最方便的,随手查了下,找到一个很好用的脚本: #!/bin/shwhile true; do server=`ps aux | grep 进程关键字 | grep -v grep` if [ ! "$server" ]; then 启动服务的命令 sleep 10 fi sle...
赞 (0)