【问题标题】:Connect MongoDB/MySQL using javascript使用 javascript 连接 MongoDB/MySQL
【发布时间】:2012-03-03 14:39:31
【问题描述】:

如何用javascript连接数据库?

mongodb 有一些例子吗?还是mysql?

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]]` `[/[database][?options]]

可以在 tcp 服务器中使用的数据库的性能?:

~/$ ./mongod

db.adminCommand({movePrimary:, to:})

  //enable sharding on the database, and move it to the shard01

use test1 //新建数据库 db.adminCommand({enablesharding : "test1"}) db.adminCommand({movePrimary : "test1", to : "shard01" }) //这将影响test1 db上的新集合 //在数据库上启用分片,并将其移动到shard01 使用 test1 //新建数据库 db.adminCommand({enablesharding : "test1"}) db.adminCommand({movePrimary : "test1", to : "shard01" }) //这将影响test1 db上的新集合

【问题讨论】:

    标签: javascript mysql mongodb database


    【解决方案1】:

    我知道您现在可能已经想通了,但请查看此链接:

    http://docs.mongodb.org/ecosystem/tools/http-interfaces/#simple-rest-api

    您应该能够通过 Javascript 中的 ajax 调用访问 MongoDB 并接收 JSON 对象作为您的响应。

    【讨论】:

      猜你喜欢
      • 2021-08-12
      • 2015-12-25
      • 2017-11-14
      • 2016-10-28
      • 2018-07-19
      • 2017-04-09
      • 1970-01-01
      • 1970-01-01
      • 2019-12-10
      相关资源
      最近更新 更多