Skip to content

Instantly share code, notes, and snippets.

#[macro_export]
macro_rules! avec {
($($element:expr),*) => {{
// check that count is const
const C: usize = $crate::count![@COUNT; $($element),*];
#[allow(unused_mut)]
let mut vs = Vec::with_capacity(C);
$(vs.push($element);)*
vs
diff --git a/Cargo.toml b/Cargo.toml
index d060d71..88f8a02 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,3 +1,3 @@
-[workspace]
-version = "3.0"
-members = ["backend", "indexer", "mpc", "store"]
+[workspace]
+version = "3.0"
@akash-wt
akash-wt / account.js
Last active October 3, 2024 09:40
Session in MongoDB
// creating a session
const session = await mongoose.startSession();
// Starting a Session
session.startTransaction();
//Performing Operations Within a Session
const fromUser = await Account.findOne({ userId: req.userId }).session(session);
const toUser = await Account.findOne({ userId: data.to }).session(session);
await Account.updateOne(