Search By Label
async function* fetchUsers() { let page = 1; const perPage = 10; // Number of users per page
while (true) { const response = await fetch(`https://api.example.com/users?page=${page}&per_page=${perPage}`); const users = await response.json();
if (users.length === 0) { // No more users to fetch break; }
for (const user of users) { yield user; }
page++; } }
// Usage:
const userGenerator = fetchUsers();(async () => {
for await (const user of userGenerator) {
console.log(`User: ${user.name}, Email: ${user.email}`);
}
})();
{ "range": { "price": { "gte": 20, "lte": 50 } } }
{ "range": { "event_date": { "gte": "2023-01-01", "lte": "2023-12-31" } } }
SELECT regexp_match(column_name, 'your_regex_pattern') AS matched_text FROM table_name;
SELECT MIN(column_name) FROM table_name;
SELECT MAX(column_name) FROM table_name;
SELECT order_id, string_agg(product_name, ', ') AS products FROM order_details GROUP BY order_id;
-- Example: Match strings that end with '-dev' SELECT * FROM your_table WHERE your_column LIKE '%-dev';
UPPER(string)
LOWER(string)
-- Create a view named "customer_orders" to show orders for a specific customer CREATE VIEW customer_orders AS SELECT order_id, order_date FROM orders WHERE customer_id = '12345';
SUBSTRING(string FROM start_position [FOR length])
SELECT column1, column2, ... FROM table_name WHERE column_name IN (value1, value2, ...);
let someValue = "Hello"; let isTruthy = !!someValue; console.log(isTruthy); // truesomeValue = 0; let isFalsy = !!someValue; console.log(isFalsy); // false
git grep [options] pattern