以下の内容はhttps://htn20190109.hatenablog.com/entry/2025/03/29/132456より取得しました。


FerretDB

(24)
https://opensource.microsoft.com/blog/2025/01/23/documentdb-open-source-announcement/
https://github.com/microsoft/documentdb

https://docs.ferretdb.io/installation/ferretdb/deb/
https://www.mongodb.com/ja-jp/docs/mongodb-shell/install/

https://dincosman.com/2024/05/14/ferretdb-installation/

CPU: 1
メモリ: 8G

mongosh --> FerreDB --> PostgreSQL(DocumentDB)


前提: Docker インストール済み

-- 1. PostgreSQL with DocumentDBコンテナ起動


git clone https://github.com/microsoft/documentdb.git
cd documentdb/
docker build . -f .devcontainer/Dockerfile -t documentdb 

docker image ls

docker run -v $(pwd):/home/documentdb/code -it documentdb /bin/bash 

cd code
make 
sudo make install

./scripts/start_oss_server.sh
psql -p 9712 -d postgres

SELECT documentdb_api.create_collection('documentdb','patient');

select documentdb_api.insert_one('documentdb','patient', '{ "patient_id": "P001", "name": "Alice Smith", "age": 30, "phone_number": "555-0123", "registration_year": "2023","conditions": ["Diabetes", "Hypertension"]}');

SELECT document FROM documentdb_api.collection('documentdb','patient');

 

docker run  -d -p 5432:5432 -v $(pwd):/home/documentdb/code -it documentdb /bin/bash 
docker container ls

docker exec -it hardcore_swartz /bin/bash 

cd code
make 
sudo make install
./scripts/start_oss_server.sh
psql -p 9712 -d postgres

show listen_addresses;
show port;

ALTER SYSTEM SET listen_addresses = '*';
ALTER SYSTEM SET port = 5432;

cd /home/documentdb/documentdb_test
cp pg_hba.conf pg_hba.conf.1
echo "host    all             all             0.0.0.0/0            trust" >> pg_hba.conf 

 


export PGDATA=/home/documentdb/documentdb_test
/usr/lib/postgresql/16/bin/pg_ctl status
/usr/lib/postgresql/16/bin/pg_ctl stop
/usr/lib/postgresql/16/bin/pg_ctl start -D /home/documentdb/documentdb_test
/usr/lib/postgresql/16/bin/pg_ctl status

psql -p 5432 -d postgres

exit

 

sudo apt install postgresql-client-common
sudo apt install postgresql-client-16

psql -h localhost -p 5432 -U documentdb -d postgres

 


-- 2. FerretDBインストール

wget https://github.com/FerretDB/FerretDB/releases/download/v2.0.0/ferretdb-linux-amd64.deb

mv ferretdb-linux-amd64.deb ferretdb.deb

sudo dpkg -i ferretdb.deb

ferretdb --version

 

ferretdb --postgresql-url="postgres://documentdb:documentdb@192.168.137.182:5432/postgres" --listen-addr="192.168.137.182:27002" --no-auth


-- 3. mongoshインストール

wget -qO- https://www.mongodb.org/static/pgp/server-8.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-8.0.asc


echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt-get update
sudo apt-get install -y mongodb-mongosh
mongosh --version

 


-- 4. 動作確認


mongosh mongodb://192.168.137.182:27002


show dbs

use db11

db.createCollection('tab1')
show collections

db.tab1.insertOne(
   { _id: 0, col1: "val10", col2 : 20, col3 : ["val310","val320"], col4: { col41: 410, col42: "val420" } }
)

db.tab1.countDocuments()
db.tab1.find()

 

 

(12)
https://opensource.microsoft.com/blog/2025/01/23/documentdb-open-source-announcement/
https://github.com/microsoft/documentdb

https://docs.ferretdb.io/installation/ferretdb/deb/
https://www.mongodb.com/ja-jp/docs/mongodb-shell/install/

https://dincosman.com/2024/05/14/ferretdb-installation/


CPU: 1
メモリ: 8G

 

mongosh --> FerreDB --> PostgreSQL(DocumentDB)


前提: Docker インストール済み

-- 1. PostgreSQL with DocumentDBコンテナ起動


git clone https://github.com/microsoft/documentdb.git
cd documentdb/
docker build . -f .devcontainer/Dockerfile -t documentdb 

docker image ls

chmod -R 777 /root
docker run -v $(pwd):/home/documentdb/code -it documentdb /bin/bash 


cd code
make 
sudo make install

./scripts/start_oss_server.sh
psql -p 9712 -d postgres

SELECT documentdb_api.create_collection('documentdb','patient');

select documentdb_api.insert_one('documentdb','patient', '{ "patient_id": "P001", "name": "Alice Smith", "age": 30, "phone_number": "555-0123", "registration_year": "2023","conditions": ["Diabetes", "Hypertension"]}');

SELECT document FROM documentdb_api.collection('documentdb','patient');

 

docker run  -d -p 5432:5432 -v $(pwd):/home/documentdb/code -it documentdb /bin/bash 
docker container ls

docker exec -it optimistic_black /bin/bash 

cd code
make 
sudo make install
./scripts/start_oss_server.sh
psql -p 9712 -d postgres

show listen_addresses;
show port;

ALTER SYSTEM SET listen_addresses = '*';
ALTER SYSTEM SET port = 5432;

cd /home/documentdb/documentdb_test
cp pg_hba.conf pg_hba.conf.1
echo "host    all             all             0.0.0.0/0            trust" >> pg_hba.conf 

 


export PGDATA=/home/documentdb/documentdb_test
/usr/lib/postgresql/16/bin/pg_ctl status
/usr/lib/postgresql/16/bin/pg_ctl stop
/usr/lib/postgresql/16/bin/pg_ctl start -D /home/documentdb/documentdb_test
/usr/lib/postgresql/16/bin/pg_ctl status

psql -p 5432 -d postgres

exit

 

sudo apt install postgresql-client-common
sudo apt install postgresql-client-16

psql -h localhost -p 5432 -U documentdb -d postgres

 


-- 2. FerretDBインストール

wget https://github.com/FerretDB/FerretDB/releases/download/v2.0.0/ferretdb-linux-amd64.deb

mv ferretdb-linux-amd64.deb ferretdb.deb

sudo dpkg -i ferretdb.deb

ferretdb --version

 

ferretdb --postgresql-url="postgres://documentdb:documentdb@192.168.137.189:5432/postgres" --listen-addr="192.168.137.189:27002" --no-auth


-- 3. mongoshインストール

wget https://downloads.mongodb.com/compass/mongosh-2.4.2-linux-x64.tgz

tar -zxvf mongosh-2.4.2-linux-x64.tgz
cd mongosh-2.4.2-linux-x64
chmod +x bin/mongosh

sudo cp bin/mongosh /usr/local/bin/
sudo cp bin/mongosh_crypt_v1.so /usr/local/lib/
mongosh --version


-- 4. 動作確認


mongosh mongodb://192.168.137.189:27002


show dbs

use db11

db.createCollection('tab1')
show collections

db.tab1.insertOne(
   { _id: 0, col1: "val10", col2 : 20, col3 : ["val310","val320"], col4: { col41: 410, col42: "val420" } }
)

db.tab1.countDocuments()
db.tab1.find()

 

 

(RL9)


https://opensource.microsoft.com/blog/2025/01/23/documentdb-open-source-announcement/
https://github.com/microsoft/documentdb

https://docs.ferretdb.io/installation/ferretdb/rpm/
https://www.mongodb.com/ja-jp/docs/mongodb-shell/install/

https://dincosman.com/2024/05/14/ferretdb-installation/


CPU: 1
メモリ: 8G

 

mongosh --> FerreDB --> PostgreSQL(DocumentDB)


前提: Docker インストール済み

-- 1. PostgreSQL with DocumentDBコンテナ起動


git clone https://github.com/microsoft/documentdb.git
cd documentdb/
docker build . -f .devcontainer/Dockerfile -t documentdb 

 

docker image ls

chmod -R 777 /root
docker run -v $(pwd):/home/documentdb/code -it documentdb /bin/bash 


cd code
make 
sudo make install

./scripts/start_oss_server.sh
psql -p 9712 -d postgres

SELECT documentdb_api.create_collection('documentdb','patient');

select documentdb_api.insert_one('documentdb','patient', '{ "patient_id": "P001", "name": "Alice Smith", "age": 30, "phone_number": "555-0123", "registration_year": "2023","conditions": ["Diabetes", "Hypertension"]}');

SELECT document FROM documentdb_api.collection('documentdb','patient');

 

docker run  -d -p 5432:5432 -v $(pwd):/home/documentdb/code -it documentdb /bin/bash 
docker container ls

docker exec -it amazing_ride /bin/bash 

cd code
make 
sudo make install
./scripts/start_oss_server.sh
psql -p 9712 -d postgres

show listen_addresses;
show port;

ALTER SYSTEM SET listen_addresses = '*';
ALTER SYSTEM SET port = 5432;

cd /home/documentdb/documentdb_test
cp pg_hba.conf pg_hba.conf.1
echo "host    all             all             0.0.0.0/0            trust" >> pg_hba.conf 

 


export PGDATA=/home/documentdb/documentdb_test
/usr/lib/postgresql/16/bin/pg_ctl status
/usr/lib/postgresql/16/bin/pg_ctl stop
/usr/lib/postgresql/16/bin/pg_ctl start -D /home/documentdb/documentdb_test
/usr/lib/postgresql/16/bin/pg_ctl status

psql -p 5432 -d postgres

exit

 

 

dnf -y search postgresql16
dnf -y install postgresql16

psql -h localhost -p 5432 -U documentdb -d postgres

 


-- 2. FerretDBインストール

wget https://github.com/FerretDB/FerretDB/releases/download/v2.0.0/ferretdb-linux-amd64.rpm

mv ferretdb-linux-amd64.rpm ferretdb.rpm

sudo rpm -i ferretdb.rpm

ferretdb --version

 

ferretdb --postgresql-url="postgres://documentdb:documentdb@192.168.137.190:5432/postgres" --listen-addr="192.168.137.190:27002" --no-auth


-- 3. mongoshインストール


wget https://downloads.mongodb.com/compass/mongosh-2.4.2-linux-x64.tgz

tar -zxvf mongosh-2.4.2-linux-x64.tgz
cd mongosh-2.4.2-linux-x64
chmod +x bin/mongosh

sudo cp bin/mongosh /usr/local/bin/
sudo cp bin/mongosh_crypt_v1.so /usr/local/lib/
mongosh --version


-- 4. 動作確認


mongosh mongodb://192.168.137.190:27002


show dbs

use db11

db.createCollection('tab1')
show collections

db.tab1.insertOne(
   { _id: 0, col1: "val10", col2 : 20, col3 : ["val310","val320"], col4: { col41: 410, col42: "val420" } }
)

db.tab1.countDocuments()
db.tab1.find()

 

 

 

 

(2025)

https://docs.ferretdb.io/installation/ferretdb/windows/


未サポートの模様

 

 




以上の内容はhttps://htn20190109.hatenablog.com/entry/2025/03/29/132456より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14