mongodb-js / mongo-views Goto Github PK
View Code? Open in Web Editor NEWVirtual collections - aka views with joins - in the MongoDB shell.
License: MIT License
Virtual collections - aka views with joins - in the MongoDB shell.
License: MIT License
$ ./mongo --nodb
MongoDB shell version: 3.1.0-pre-
mongo-views is initiating!
2015-03-11T12:20:29.187-0400 E QUERY ReferenceError: db is not defined
at getCurrentDb (/Users/charlie/github/my-mongo-views/lib/config.js:23:20)
at loadViewsInDB (/Users/charlie/github/my-mongo-views/lib/init.js:94:13)
at Object.init.js (/Users/charlie/github/my-mongo-views/lib/init.js:133:5)
at DBCollection (/Users/charlie/.mongo-views.js:29:34)
at /Users/charlie/.mongo-views.js:31:3
at /Users/charlie/.mongorc.js:2:1 at /Users/charlie/github/my-mongo-views/lib/config.js:23
2015-03-11T12:20:29.187-0400 E QUERY Error: error loading js file: /Users/charlie/.mongo-views.js
at /Users/charlie/.mongorc.js:2:1 at /Users/charlie/.mongorc.js:2
The ".mongorc.js" file located in your home folder could not be executed
Steps to repro:
use db2
show views
doesn't load the appropriate dbs> db.employees.insert(
... [
... {name: "John", dob: new Date(1980, 1, 2)},
... {name: "Paul", manager: true, dob: new Date(1983, 7, 10), uid: 3},
... {name: "Mary", dob: new Date(1985, 5, 12), uid: 20},
... {name: "Aimee", manager: true, dob: new Date(1945, 2, 20), uid: 50}
... ]
... )
> db.employees.createView("managers")
WriteResult({ "nInserted" : 1 })
> db._managers.find()
Error: error: {
"$err" : "Can't canonicalize query: BadValue $or/$and/$nor entries need to be full objects",
"code" : 17287
}
But this works:
db.employees.createView("managers", {})
Steps to repro:
db.createView('managers', { name: /john/})
restart shell
and nothing is returned from the query.
persistence for regex looks like
{
"_id": ObjectId("54f8a114ad4fc3af583357f2"),
"name": "managers",
"target": "employees",
"query": "{\"name\":{}}",
"projection": "{}"
}
Including a regex in criteria, such as { name: /john/ }
, will not load on startup. The reason is that JSON.stringify is not correctly serializing regular expressions.
Steps to reproduce:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.