MongoDB Atlas provides a set of API endpoints that can be used to access the database hosted on Atlas without the need for database drivers; great for minimal memory footprint, especially on serverless infrastructures such as AWS Lambda.
[Read More]SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
Same code working locally, but not on a remote server. Migrating aws-sdk to @aws-sdk/client-s3
Using AWS S3 functionality in our node application, this issue suddenly broke our functionality for no plausible reason. The strange aspect was that the same thing worked correctly on the local server, but any remote server would throw this error.
[Read More]Yup Date Format Validation With Moment JS
Yup Number Validation: Allow Empty String
With min and max number validation.
Exactly Same Query Behaving Differently in Mongo Client and Mongoose
Understanding Mongoose's strict schema handling
You might notice that the same query behaves differently in a MongoDB client, like Compass or mongo shell, compared to when using Mongoose within a Node.js application. Below is one such scenario.
[Read More]MongoDB Single Update Query to Change the Field Name in All Matching Documents of the Collection
Including field name in nested object and array of objects.
JavaScript Unit Testing JSON Schema Validation
AWS Layer: Generate nodejs Zip Layer File Based on the Lambda's Dependencies
We want to create an AWS layer zip file containing all the node_modules
used by a particular AWS lambda function.
In Node JS HTML to PDF conversion, Populate Images From URLs
Using axios and base64 conversion
In continuation of my previous post Convert HTML to PDF in Node JS without headless browser, I will show you how can we can fetch the images from URL, convert them into base64 string, and populate them in the HTML that is then converted into PDF.
[Read More]Convert HTML to PDF in Nodejs
Without Puppeteer, phantomjs or any other headless browser.
To convert an HTML to PDF in the backend, you usually need a headless browser like Puppeteer or phantomjs. The downside of headless browsers is that they are resource intensive. If you need to convert an HTML in Nodejs, is there a way to do so without them? The answer is yes but with a caveat: The HTML should be relatively simple, and you will only have a few options to style the document.
[Read More]