Home  >  Article  >  Database  >  mongodbnewlispdriverv0.1.0发布

mongodbnewlispdriverv0.1.0发布

WBOY
WBOYOriginal
2016-06-07 16:11:021033browse

一直以来,没有newlisp直接访问mongodb 的方式,今天发布了v0.1.0版本,可以让newlisp通过mongdb c driver访问mongodb server. 下面是例子代码: #!/usr/bin/newlisp(load mongo.lsp)(mongo:init)(set client-ptr (mongo:connect mongodb://127.0.0.1/))(set

一直以来,没有newlisp直接访问mongodb 的方式,今天发布了v0.1.0版本,可以让newlisp通过mongdb c driver访问mongodb server.

下面是例子代码:

 

#!/usr/bin/newlisp

(load "mongo.lsp")
(mongo:init)
(set 'client-ptr (mongo:connect "mongodb://127.0.0.1/"))
(set 'db-ptr (mongo:get-db client-ptr "kaimei"))
(println "db-ptr: " db-ptr)

(set 'db-name (mongo:get-db-name db-ptr))
(println "db-name: " db-name)

(mongo:destroy-db db-ptr)
(mongo:destroy-client client-ptr)
(mongo:cleanup)

(exit)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn