### Initialize Node.js Application Source: https://www.mongodb.com/docs/get-started Setup commands to create the project directory and install the MongoDB driver. ```shell mkdir node-quickstart cd node-quickstart touch index.js npm init -y npm install mongodb ``` ```shell mkdir node-quickstart cd node-quickstart type nul > index.js npm init -y npm install mongodb ``` -------------------------------- ### Initialize Project and Install Dependencies Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/ai-agents Commands to create the project directory and install necessary packages for the AI agent. ```none mkdir mongodb-ai-agent cd mongodb-ai-agent npm init -y npm install --quiet dotenv mongodb voyageai openai langchain @langchain/community @langchain/core mathjs pdf-parse ``` -------------------------------- ### Local Atlas Deployment Setup Output Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start This output indicates the successful installation of the atlas-local-plugin and the progress of setting up the local Atlas deployment, including confirmation of sample data loading. ```text "Installing first class plugin atlas-local-plugin" "Plugin mongodb/atlas-local-cli successfully installed" [1/4] [✅] Pulling the latest version of the MongoDB image... [2/4] [✅] Creating the deployment... [3/4] [✅] Starting the deployment... [4/4] [✅] Waiting for the deployment to be healthy... {"outcome":"setup","deployment_name":"local7816","mongodb_version":"8.2.5","port":53211,"load_sample_data":true,"connect_result":{"connect_outcome":"skipped"}} ``` -------------------------------- ### Select Setup Method (Interactive Custom) Source: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local Choose 'custom - With custom settings' for detailed configuration of your local MongoDB database during interactive setup. ```sh ? How do you want to setup your local MongoDB database? [Use arrows to move, type to filter] default - With default settings > custom - With custom settings cancel - Cancel set up ``` -------------------------------- ### Run Python Application Source: https://www.mongodb.com/docs/get-started Execute the quickstart script from the project directory. ```shell python3 quickstart.py ``` -------------------------------- ### Select Setup Method (Interactive) Source: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local Choose how to set up the local MongoDB database. Options include 'default - With default settings', 'custom - With custom settings', or 'cancel - Cancel set up'. ```sh ? How do you want to setup your local MongoDB database? [Use arrows to move, type to filter] > default - With default settings custom - With custom settings cancel - Cancel set up ``` -------------------------------- ### Compile and Run Java Tutorial Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-tutorial Use these commands to compile and run the AtlasVectorSearchTutorial.java file. This is the setup for both AND and OR operator examples. ```shell javac AtlasVectorSearchTutorial.java ``` ```shell java AtlasVectorSearchTutorial ``` -------------------------------- ### Start an Atlas Deployment Source: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local Starts a paused deployment. ```sh atlas deployments start ``` -------------------------------- ### Install MongoDB Atlas CLI and Docker on Windows Source: https://www.mongodb.com/docs/get-started Installs the Atlas CLI and Docker Desktop using Chocolatey. Ensure Chocolatey is installed first. ```shell choco install mongodb-atlas choco install docker-desktop ``` -------------------------------- ### Initialize Go Project Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-quantization Create a new directory and initialize a Go module for your project. ```shell mkdir ingest-binary-vectors-project cd ingest-binary-vectors-project go mod init ingest-binary-vectors-project ``` -------------------------------- ### Initialize .NET Project Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start Commands to create a new directory and initialize a console application. ```bash mkdir query-quick-start cd query-quick-start dotnet new console ``` -------------------------------- ### Install MongoDB Atlas CLI and Docker on macOS Source: https://www.mongodb.com/docs/get-started Installs the Atlas CLI and Docker Desktop using Homebrew. Ensure Homebrew is installed first. ```shell brew install mongodb-atlas brew install --cask docker ``` -------------------------------- ### Initialize Go Project Source: https://www.mongodb.com/docs/get-started Commands to create a project directory, initialize a Go module, and install the MongoDB driver. ```shell mkdir go-quickstart cd go-quickstart go mod init go-quickstart go get go.mongodb.org/mongo-driver/v2/mongo touch main.go ``` ```shell mkdir go-quickstart cd go-quickstart go mod init go-quickstart go get go.mongodb.org/mongo-driver/v2/mongo type nul > main.go ``` -------------------------------- ### Install MongoDB PHP Driver Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start Instructions for installing the MongoDB PHP driver. Refer to the official MongoDB PHP Library documentation for comprehensive installation steps. ```text For detailed installation instructions, see the [MongoDB PHP Library documentation](https://www.mongodb.com/docs/php-library/current/get-started/#std-label-php-download-and-install). ``` -------------------------------- ### Install Dependencies for MongoDB AI Agent Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/ai-agents Installs necessary Python packages for building an AI agent with MongoDB integration. Ensure you have Python and pip installed. ```none mkdir mongodb-ai-agent cd mongodb-ai-agent pip install --quiet --upgrade pymongo voyageai openai langchain langchain-mongodb langchain-community python-dotenv ``` -------------------------------- ### Create a C++ quickstart application Source: https://www.mongodb.com/docs/get-started A basic C++ application that connects to a MongoDB cluster and performs a find_one query. ```cpp #include #include #include #include #include #include #include #include using bsoncxx::builder::basic::kvp; using bsoncxx::builder::basic::make_document; int main() { mongocxx::instance instance; mongocxx::uri uri(""); mongocxx::client client(uri); auto db = client["sample_mflix"]; auto collection = db["movies"]; auto result = collection.find_one(make_document(kvp("title", "The Shawshank Redemption"))); if (result) { std::cout << bsoncxx::to_json(*result) << std::endl; } else { std::cout << "No result found" << std::endl; } } ``` -------------------------------- ### Install PyMongo Driver Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-tutorial Install the required Python driver for MongoDB interaction. ```sh pip install pymongo ``` -------------------------------- ### Build and install the driver Source: https://www.mongodb.com/docs/get-started Commands to compile and install the driver on macOS and Windows. ```bash cmake --build . sudo cmake --build . --target install ``` ```bash cmake --build . --config RelWithDebInfo cmake --build . --target install --config RelWithDebInfo ``` -------------------------------- ### Initialize Node.js Project Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/hybrid-search/vector-search-with-full-text-search Commands to set up a new directory, initialize npm, and install the MongoDB driver. ```shell # Create a new directory and initialize the project mkdir atlas-search-project && cd atlas-search-project npm init -y # Add the MongoDB Node.js Driver to your project npm install mongodb ``` -------------------------------- ### Select Deployment Type (Interactive) Source: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local During interactive setup, choose the type of deployment. Select 'local - Local Database' to set up a local instance. ```sh ? What would you like to deploy? [Use arrows to move, type to filter, ? for more help] > local - Local Database atlas - Atlas Database ``` -------------------------------- ### Example script output Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-quantization This is an example of the expected output when the upload script runs successfully. ```text Connected to MongoDB Updated document with text: ... ... Embeddings stored in MongoDB successfully. ``` -------------------------------- ### Initialize PHP Application and Install MongoDB Extension (Windows) Source: https://www.mongodb.com/docs/get-started Creates a new directory, a PHP file, installs the MongoDB extension using 'pie', and requires the MongoDB Composer package on Windows. ```shell mkdir php-get-started cd php-get-started type nul > getstarted.php pie install mongodb/mongodb-extension composer require mongodb/mongodb ``` -------------------------------- ### Install MongoDB Ruby Driver Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start Commands to initialize a Gemfile and install the MongoDB Ruby driver dependency. ```sh bundle init ``` ```ruby gem "mongo" ``` ```sh bundle install ``` -------------------------------- ### Install Atlas CLI with Homebrew Source: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local Use this command to install the Atlas CLI if you are using Homebrew on macOS. ```bash brew install mongodb-atlas-cli ``` -------------------------------- ### Create Tutorial File Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-tutorial Instruction for creating a new Node.js file for MongoDB Atlas Vector Search. ```bash #### Create a file named `atlas-vector-search-tutorial.js`. ``` -------------------------------- ### Initialize Project Directory Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start Navigate to the project folder and create the required CMake configuration file. ```bash cd query-quick-start touch CMakeLists.txt ``` -------------------------------- ### Example Query Embeddings Data Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start This is an example of the data structure for query embeddings, represented as an array of numbers. ```javascript [ -0.017033506,-0.027087428,0.044536386,-0.038055345,0.001329444,-0.019609304,0.023597637,-0.043206941,0.040049512,0.017615138,0.046862911,0.02127111,0.013294443,-0.039550968,-0.018861491,-0.019609304,-0.033734649,0.00623177,-0.017199686,0.041212775,-0.017781317,-0.024262359,0.054507218,-0.009721561,0.005816319,-0.00206687,-0.008766023,0.017365867,-0.000737426,0.018362951,-0.023597637,-0.019110762,0.021935832,0.041545134,-0.020357117,-0.017615138,0.044868745,-0.018030589,-0.032405205,-0.050186522,-0.014540797,0.005213914,-0.006688767,0.047527634,0.040714234 ] ``` -------------------------------- ### Install MongoDB Driver and dotenv Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-quantization Install the necessary dependencies for the MongoDB Node.js driver and environment variable management. ```shell npm install mongodb dotenv ``` -------------------------------- ### Execute the Agent via Command Line Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/ai-agents Command to start the agent application. ```none python main.py ``` -------------------------------- ### Set up Python Project for Atlas Search Source: https://www.mongodb.com/docs/atlas/atlas-search/field-types/number-type Installs PyMongo for interacting with MongoDB. Ensure you have Python and pip installed. ```shell mkdir atlas-search-project && cd atlas-search-project pip install pymongo ``` -------------------------------- ### Set up a Python Project for MongoDB Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/hybrid-search/vector-search-with-full-text-search Commands to initialize a project directory and install the PyMongo driver. ```shell # Create a new directory for the project mkdir atlas-search-project && cd atlas-search-project # Install PyMongo pip install pymongo ``` -------------------------------- ### Initialize Node.js Project Directory Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-quantization Create a new project directory and initialize it with default settings using npm. ```shell mkdir my-quantization-project cd my-quantization-project npm init -y ``` -------------------------------- ### Initialize Go Module and Add MongoDB Driver Source: https://www.mongodb.com/docs/atlas/atlas-search/field-types/number-type Set up a new Go project directory and initialize the Go module. Then, add the MongoDB Go Driver to your project dependencies. This is the initial setup for using the driver in a Go application. ```shell # Create a new directory and initialize the project mkdir atlas-search-project && cd atlas-search-project go mod init atlas-search-project # Add the MongoDB Go Driver to your project go get go.mongodb.org/mongo-driver/v2/mongo ```