This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Episode 99:: | |
db.COLLECTION.find() //find returns a cursor | |
db.COLLECTION.find().count() | |
db.COLLECTION.next() //gives next one document | |
const dataCursor = db.COLLECTION.find() //store cursor in a variable | |
dataCursor.next() //gives next one document | |
datacursor.forEach(doc => {printjson(doc)}) //prints all documents one by one (printjson is provided by mongo shell) | |
//after the above forEach the dataCursor.next() will give error, because the cursor is empty | |
dataCursor.hasNext() //gives if there is any next document available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Main context (this is the global configuration) | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace Rafi\Commission; | |
use Rafi\CurrencyExchangeRate\FetchContent; | |
class AmountCurrencyAware | |
{ |