jstests/aggregation/extras/window_function_helpers.js
/**
 * Create a collection of tickers and prices.
 */
Create a collection of tickers and prices.
Create a collection of tickers and prices .
function seedWithTickerData(coll, docsPerTicker) {
    for (let i = 0; i < docsPerTicker; i++) {
        assert.commandWorked(
            coll.insert({_id: i, partIndex: i, ticker: "T1", price: (500 - i * 10)}));
        assert.commandWorked(coll.insert(
            {_id: i + docsPerTicker, partIndex: i, ticker: "T2", price: (400 + i * 10)}));
    }
}
function seedWithTickerData ( coll , docsPerTicker ) { for ( let i = 0 ; i < docsPerTicker ; i ++ ) { assert . commandWorked ( coll . insert ( { _id : i , partIndex : i , ticker : "T1" , price : ( 500 - i * 10 ) } ) ) ; assert . commandWorked ( coll . insert ( { _id : i + docsPerTicker , partIndex : i , ticker : "T2" , price : ( 400 + i * 10 ) } ) ) ; } }
Create a collection of tickers and prices.
Create a collection of tickers and prices .