https://github.com/mongodb-developer/docker-golang-example
https://github.com/mongodb-developer/docker-golang-example
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mongodb-developer/docker-golang-example
- Owner: mongodb-developer
- Archived: true
- Created: 2021-07-29T17:51:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-18T12:11:51.000Z (9 months ago)
- Last Synced: 2025-02-16T02:44:07.833Z (4 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 4
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notice: Repository Deprecation
This repository is deprecated and no longer actively maintained. It contains outdated code examples or practices that do not align with current MongoDB best practices. While the repository remains accessible for reference purposes, we strongly discourage its use in production environments.
Users should be aware that this repository will not receive any further updates, bug fixes, or security patches. This code may expose you to security vulnerabilities, compatibility issues with current MongoDB versions, and potential performance problems. Any implementation based on this repository is at the user's own risk.
For up-to-date resources, please refer to the [MongoDB Developer Center](https://mongodb.com/developer).# Docker with Golang and MongoDB
## Instructions (Go Application)
Before trying to run this application, make sure you've added your qualified MongoDB URI to your environment variables path. Example:
```
export MONGODB_URI="mongodb+srv://demo:[email protected]/myFirstDatabase?retryWrites=true&w=majority"
```To run the application, execute the following:
```
go run main.go
```To build the application, execute the following:
```
go build
```If you are attempting to cross-compile, make sure you properly define the destination architecture and operating system information.