# Interact with MongoDB in an AWS Lambda Function Using Go

DevFeed: [Interact with MongoDB in an AWS Lambda Function Using Go](<https://devfeed.tech/articles/interact-with-mongodb-in-an-aws-lambda-function-using-go-21822.md>)

Original publisher: [Read original article](<https://www.thepolyglotdeveloper.com/blog/2023/01/interact-aws-lambda-function-go/>)

Author: Nic Raboy

Published: 2023-01-25T14:00:00Z

Content type: tutorial

Language: en

Sources: [Nic Raboy](<https://devfeed.tech/sources/nic-raboy.md>)

Topics: [AWS Lambda](<https://devfeed.tech/topics/aws-lambda.md>), [MongoDB](<https://devfeed.tech/topics/mongodb.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Serverless](<https://devfeed.tech/topics/serverless.md>)

Tags: [atlas](<https://devfeed.tech/tags/atlas.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-lambda](<https://devfeed.tech/tags/aws-lambda.md>), [getting-started](<https://devfeed.tech/tags/getting-started.md>), [go](<https://devfeed.tech/tags/go.md>), [golang](<https://devfeed.tech/tags/golang.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [nosql](<https://devfeed.tech/tags/nosql.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [serverless](<https://devfeed.tech/tags/serverless.md>)

## AI overview

This tutorial shows how to build a Go-based AWS Lambda function that connects to and queries MongoDB Atlas. It covers prerequisites, Go module setup, and installation of the MongoDB driver and AWS Lambda SDK, with attention to efficient database connections in a serverless environment.

## Source excerpt

If you're a Go developer and you're looking to go serverless, AWS Lambda is a solid choice that will get you up and running in no time. But what happens when you need to connect to your database? With... The post Interact with MongoDB in an AWS Lambda Function Using Go appeared first on MongoDB.