Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreamsxin/postgres-function
https://github.com/dreamsxin/postgres-function
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dreamsxin/postgres-function
- Owner: dreamsxin
- Created: 2014-12-09T08:48:25.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-11T02:39:30.000Z (about 10 years ago)
- Last Synced: 2024-10-30T03:49:01.946Z (3 months ago)
- Language: C
- Size: 5.63 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
postgres-function
=================```shell
git clone https://github.com/dreamsxin/postgres-function.git
cd postgres-function
cd mongo-c-driver-1.0.2
autoreconf -ivf .
./configure && make && sudo make install
cd ..
make && sudo make install
``````sql
CREATE EXTENSION mongo;SELECT mongo_save(
'mongodb://127.0.0.1:27017',
'database',
'collection',
'{"field":"value"}',
'{"query filed":"value"}'
);SELECT mongo_find(
'mongodb://127.0.0.1:27017',
'database',
'collection',
'{"query field":"value"}'
)->'postgresql';SELECT mongo_save(
'mongodb://127.0.0.1:27017',
'database',
'collection',
(SELECT row_to_json(t) FROM (SELECT id as user_id, phone FROM users WHERE id=1) t),
'{"user_id":1}'
);SELECT * FROM mongo_find_all(
'mongodb://127.0.0.1:27017',
'database',
'collection',
'{}'
);
```