title UserData @echo off set classdir = WebRoot\WEB-INF\lib;WebRoot\WEB-INF\classes; setlocal ENABLEDELAYEDEXPANSION set classpath=%classpath%;%classdir% for /R "WebRoot\WEB-INF\lib" %%i in (*.jar) do set classpath=!classpath!;%%i java com.huawei.idac.userdata.Startup setlocal DISABLEDELAYEDEXPANSION endlocal pause
登录主服务器:
$ mongodb/bin/mongo --port 28018
MongoDB shell version: 1.2.4-
url: test
connecting to: 127.0.0.1:28018/test
type "help" for help
> show dbs
admin
local
test
> use test
switched to db test
> show collections
这里主上的test数据什么表都没有,为空,查看从服 务器同样也是这样
$ mongodb/bin/mongo --port 28019
MongoDB shell version: 1.2.4-
url: test
connecting to: 127.0.0.1:28019/test
type "help" for help
> show dbs
admin
local
test
> use test
switched to db test
> show collections
那么现在我们来验证主从数据是否会像想象的那样同步 呢?
我们在主上新建表user
> db
test
>db.createCollection("user");
> show collections
system.indexes
user
>
表 user已经存在了,而且test库中还多了一个system.indexes用来存放索引的表
3、MongoDB语法与现有关系型数据库SQL语法比较
MongoDB语法 MySql语法
db.test.find({'name':'foobar'}) <==> select * from test where name='foobar'
db.test.find() <==> select * from test
db.test.find({'ID':10}).count() <==> select count(*) from test where ID=10
db.test.find().skip(10).limit(20) <==> select * from test limit 10,20
db.test.find({'ID':{$in:[25,35,45]}}) <==> select * from test where ID in (25,35,45)
db.test.find().sort({'ID':-1}) <==> select * from test order by ID desc
db.test.distinct('name',{'ID':{$lt:20}}) <==> select distinct(name) from test where ID<20
db.test.group({key:{'name':true},cond:{'name':'foo'},reduce:function(obj,prev){prev.msum+=obj.marks;},initial:{msum:0}}) <==> select name,sum(marks) from test group by name
db.test.find('this.ID<20',{name:1}) <==> select name from test where ID<20
db.test.insert({'name':'foobar','age':25})<==>insert into test ('name','age') values('foobar',25)
db.test.remove({}) <==> delete * from test
db.test.remove({'age':20}) <==> delete test where age=20
db.test.remove({'age':{$lt:20}}) <==> elete test where age<20
db.test.remove({'age':{$lte:20}}) <==> delete test where age<=20
db.test.remove({'age':{$gt:20}}) <==> delete test where age>20
db.test.remove({'age':{$gte:20}}) <==> delete test where age>=20
db.test.remove({'age':{$ne:20}}) <==> delete test where age!=20
db.test.update({'name':'foobar'},{$set:{'age':36}}) <==> update test set age=36 where name='foobar'
db.test.update({'name':'foobar'},{$inc:{'age':3}}) <==> update test set age=age+3 where
name='foobar'
电子商务商店 资料夹结构 1. client folder contains all the front-end related stuff. 2. server folder contains all the backend related stuff. 服务器端 1. cd controllers - ... 2.... 3.... SECRET = '<JWT>
相关推荐
monodb 实战
操作monodb的c#封装,调用非常方便,可以继承,功能包括: 1、所有数据库操作 2、前台表格类数据获取 public List<Document> GetList(List<string> lstColName, Document query, JqGridParam jqParam, ref int count)...
适合monoDB初学者,希望可以帮到大家
适合monoDB初学者,希望可以帮到大家
适合monoDB初学者,希望可以帮到大家
自己毕业设计做的项目,基于vue全家桶+node.js+monodb的在线购物商城
mongodb最新版本下载安装包,linux下64位安装包
适合monoDB初学者,希望可以帮到大家
资源中存有springmongo配置,mongo数据库相关配置,mongo实现类等等
BD-NoSQL-Proyecto-2:MonoDB的ETL附加数据hacia Neo4j utilizando py2neo y pymongo
mongodb.dll.zip
NoSQL数据库之MongoDB查询
云计算平台Hadoop的部署
整理好的Mongodb常用的指令,侧重于各种查询,适合新手使用
pms部署者 将解析的 pms 比较表行部署到 mongodb
电子商务商店 资料夹结构 1. client folder contains all the front-end related stuff. 2. server folder contains all the backend related stuff. 服务器端 1. cd controllers - ... 2.... 3.... SECRET = '<JWT>
MongoDB是一个面向文档的数据库,目前由10gen开发并维护,它的功能丰富,齐全,完全可以替代MySQL。...这些modifer可以让MongoDB具有和Redis、Memcached等KV类似的功能:较之MySQL,MonoDB更加简单快速。
VEFT514-LargeAssignment2 在运行之前安装npm苏巴斯塔斯大厦您已被聘为一家名为Mansion de Subastas的艺术品销售公司的首席开发人员。 他们沉迷于NodeJS,不会接受其他任何东西作为他们的技术堆栈。...
适合新手学习,包含所有基本操作,上手快,简单易懂,实例教学
本示例将地图缓存入库到Mongodb数据里,便于其他客户端使用地图缓存,只需拷贝缓存的sci文件即可