Skip to content

Instantly share code, notes, and snippets.

View sahilrajput03's full-sized avatar
💭
I'm happy these days.

Sahil Rajput sahilrajput03

💭
I'm happy these days.
View GitHub Profile
View haq-se-single-magnet-link.txt
View my-personality.md
View a.js
// post hooks for inserMany
schema.post<MovieDocument[]>('insertMany', async function (docs, next) {
console.log('docs POST =', docs);
if (Array.isArray(docs) && docs.length) {
const correctData = docs.map((singleDoc) => {
console.log('singelDoc post before added =', JSON.stringify(singleDoc));
// If id AND name are present, then we can use them to generate the sort_name
if (singleDoc.id?.length > 0 && singleDoc.name) {
View a.json
{
"subscriber": {
"email_address": "barbuyer@gmail.com",
"payer_id": "VZXRX2AG4RY6G",
"name": {
"given_name": "BarBuyer",
"surname": "Jones"
},
"shipping_address": {
"name": {
View Learn Upgradable Smart Contracts.md