Home > Database > Mysql Tutorial > body text

mongodbnewlispdriverv0.1.0发布

WBOY
Release: 2016-06-07 16:11:02
Original
1080 people have browsed it

一直以来,没有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)
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template