{"id":24987432,"url":"https://github.com/sergi/narwhal-mongodb","last_synced_at":"2025-08-09T22:07:31.631Z","repository":{"id":699458,"uuid":"344846","full_name":"sergi/narwhal-mongodb","owner":"sergi","description":"Wrapper of MongoDB database for CommonJS","archived":false,"fork":false,"pushed_at":"2010-05-28T10:37:41.000Z","size":559,"stargazers_count":94,"open_issues_count":5,"forks_count":16,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-08-01T06:07:19.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/mrclash/narwhal-mongodb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"educastellano/qr-code","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-10-21T14:14:33.000Z","updated_at":"2023-12-08T19:48:32.000Z","dependencies_parsed_at":"2022-07-05T09:42:19.954Z","dependency_job_id":null,"html_url":"https://github.com/sergi/narwhal-mongodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sergi/narwhal-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergi%2Fnarwhal-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergi%2Fnarwhal-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergi%2Fnarwhal-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergi%2Fnarwhal-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergi","download_url":"https://codeload.github.com/sergi/narwhal-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergi%2Fnarwhal-mongodb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269644977,"owners_count":24452655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-04T11:42:59.372Z","updated_at":"2025-08-09T22:07:31.608Z","avatar_url":"https://github.com/sergi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nJavascript driver for Mongo database\n===========\n\nnarwhal-mongodb is a CommonJS-compliant JavaScript driver for the Mongo database. It wraps the official Java driver and emulates its behavior, while adding some JavaScript sugar and convenience methods.\n\n### Source \u0026 Download:\n\n* [http://github.com/mrclash/narwhal-mongodb](http://github.com/mrclash/narwhal-mongodb)\n\n\n### Mongo Homepage:\n\n* [http://www.mongodb.org/](http://www.mongodb.org/)\n\n### Mongo Java driver source\n\n* [http://github.com/mongodb/mongo-java-driver/](http://github.com/mongodb/mongo-java-driver)\n\n\nExample usage\n------------------------\n\n    var MongoDB = require(\"mongodb\");\n    var db = new MongoDB.Mongo().getDB(\"mydb\");\n\n    var colls = db.getCollectionNames();\n    colls.forEach(function(el) { print(el); });\n\n    var coll = db.getCollection(\"testCollection\");\n    coll.drop();\n\n    var doc = {\n       \"name\" : \"MongoDB\",\n       \"type\" : \"database\",\n       \"count\" : 1,\n       \"info\" : {\n                   x : 203,\n                   y : 102\n                 }\n    }\n\n    coll.insert(doc)\n    myDoc = coll.findOne();\n    print(myDoc);\n\n    // Now, lets add lots of little documents to the collection so we can explore queries and cursors\n    for (var i=0; i \u003c 100; i++) {\n        coll.insert({\"i\": i});\n    }\n\n    print(coll.getCount());\n\n    // Let's get all the documents in the collection and print them out\n\n    var cur = coll.find();\n    while(cur.hasNext()) {\n        print(cur.next());\n    }\n\n    // Now use a query to get 1 document out\n\n    var query = { i: 71 };\n    cur = coll.find(query);\n\n    while(cur.hasNext())\n        print(cur.next());\n\n    // Now use a query to get a larger set\n\n    query = { \"i\": { \"$gt\": 50 } };  // i.e. find all where i \u003e 50\n    cur = coll.find(query);\n\n    while(cur.hasNext())\n        print(cur.next());\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergi%2Fnarwhal-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergi%2Fnarwhal-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergi%2Fnarwhal-mongodb/lists"}