mongodb newlisp driver v0.1.0 发布

来源:互联网 发布:鸳鸯阵 知乎 编辑:程序博客网 时间:2024/06/06 13:14

一直以来,没有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)

项目已经在gitlab.com上开源,链接地址为:https://gitlab.com/newlisp/mongo-driver


目前支持的函数不多,后面会逐渐增加。

Index


Module: mongo

Release all resources associated with client and free the structure.

init    cleanup    connect    get-db    get-db-name    destroy-db    destroy-client    get-coll    

- ∂ -

generated with newLISP  and newLISPdoc

0 0