Code Monkey home page Code Monkey logo

mongol-meteor-explore-minimongo-devtools's Introduction

Meet Mongol, the Original Development Tool for Meteor

Starting today, you'll never have to enter the console to play with your collections again. With Mongol, you can view and edit your client documents right in the browser. And because Mongol is a debugOnly package, it does not compile to your production build.

Plug & Play Installation

Mongol configures automatically. To get started, run:

meteor add msavin:mongol

After installation, open your app in the browser and press Control + M to toggle it.

Note: the new Mongol requires Meteor 1.8

How Does It Work?

Using Mongol is like having a database management tool with-in your Meteor application. Meteor publishes data to minimongo, and Mongol hooks into it to show you all the documents on the client. With that, you can:

  • View the document counts in your minimongo collection
  • Browse the documents in your minimongo collection
  • Modify any document as if you have insecure on
  • Get a reactive window into your data

FAQ

Does Mongol require insecure to work? No, Mongol has special set of method's that allow it to interact with the database without disrupting your application permissions.

Is there a security risk to using Mongol? Since Mongol is a debugOnly package, Meteor's build process will not compile it into production code.

Will Mongol cause my application to behave differently? All of the code and functions of Mongol are pre-fixed and scoped, so there shouldn't be any intrusion.

About

Mongol is part of Meteor Toys, and is licensed under the Meteor Toys License. (C) Toys, Inc 2019. All Rights Reserved.

mongol-meteor-explore-minimongo-devtools's People

Contributors

awelles avatar gitter-badger avatar jackadams avatar jmariconda avatar mcoenca avatar msavin avatar rivertam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongol-meteor-explore-minimongo-devtools's Issues

Can't use "duplicate" option with custom _id?

I insert doc with custom _id like this:

{
  "_id": "002",
  "name": "Tehara",
  "gender": "M",
  "address": "Banteay Meanchey",
  "telephone": "070"
}

and then i insert the new one by duplicate btn, but can't it show error duplicating.

Exception in template helper: TypeError: Cannot read property 'display' of undefined

Need a way to disable the "This application contains Meteor Toys. Learn more: http://meteor.toys" message.

I appreciate the desire to introduce people to meteor.toys -- but now that I've visited the site, I would like to disable the console message so I don't see it whenever my app starts. An explicit configuration parameter or something would be helpful. As it is, I'm not really (yet) using Mongol for much, and seeing this message over and over makes it more likely that I'll just remove the package.

Getting erroneous error: "There was an error updating your document. Please review your changes and try again."

Any changes I make give me this error but, despite the error, my changes are saved properly. I just installed so I should be on 0.5.4.

The error at the server is:

I20150301-10:03:32.556(-8)? Exception while invoking method 'Mongol_update' Error: Did not check() all arguments during call to 'Mongol_update'
I20150301-10:03:32.557(-8)?     at [object Object]._.extend.throwUnlessAllArgumentsHaveBeenChecked (packages/check/match.js:357:1)
I20150301-10:03:32.557(-8)?     at Object.Match._failIfArgumentsAreNotAllChecked (packages/check/match.js:112:1)
I20150301-10:03:32.557(-8)?     at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1597:1)
I20150301-10:03:32.557(-8)?     at packages/ddp/livedata_server.js:648:1
I20150301-10:03:32.557(-8)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150301-10:03:32.557(-8)?     at packages/ddp/livedata_server.js:647:1
I20150301-10:03:32.558(-8)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150301-10:03:32.558(-8)?     at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1)
I20150301-10:03:32.558(-8)?     at packages/ddp/livedata_server.js:546:1

Client Error and can't find package sourcecode

Cross-Post from Crater.io (http://crater.io/posts/N62srhR5ojoEDFhNX):

Hi, looks great, and I'd like to try it, but I'm getting an exception:

Exception from Tracker afterFlush function: Error: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to insert the rule.
  at Error (native) at Template.MongoInspector.rendered (http://localhost:3000/packages/msavin_mongol.js?558950870b2ec9c51c4caac919a2ca3b3e8b6a76:809:26)
  at runTemplateHooks (http://localhost:3000/packages/aldeed_template-extension.js?e21d2f3f76cf4d629c394319bdb4c45f79da30f1:403:10)
  at template.(anonymous function) (http://localhost:3000/packages/aldeed_template-extension.js?e21d2f3f76cf4d629c394319bdb4c45f79da30f1:367:5)
  at null. (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:3008:21)

(...) yadda yadda.

I'd love to have a look inside the package to see what's going on, but in this repo I can't seem to find any code yet.

Is the tool itself available on github as well? Or does it just have to be pushed in its' latest version?

Thanks & best wishes

Daniel

Explicitly declare what collections you would like to see

It seems in the newest version the ability to explicitly declare what collections you would like to see in Mongol was deprecated due to the new functionality in #9. The problem is that I found that feature useful as I have 40 collections and only wanted to keep track of the main 5 collections I have. Is it possible to add that feature back as an option?

problem with "Tabular table" on Meteor.users?

I install tabular table package

TabularTable.User = new Tabular.Table({
    name: "UserList",
    collection: Meteor.users,
    columns: [
        {data: "username", title: "User Name"},
        {
            title: '<i class="fa fa-bars"></i>',
            tmpl: Meteor.isClient && Template.userAction
        }
    ]
});
// Work fine

But when install mongol, it is error on this.

drillDown function

Just thought I'd mention, Meteor has an internal function in core that does exactly this, it's called Meteor._get. e.g. Meteor._get(Meteor.user(), 'profile', 'name')

JSON circular structure error

I get the following error when trying to use a collection of mine (Orders):

Exception in template helper: TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at String.Template.MongoInspector_documentViewer.helpers.documentJSON (http://0.0.0.0:3000/packages/msavin_mongol.js?558950870b2ec9c51c4caac919a2ca3b3e8b6a76:540:36)
    at bindDataContext (http://0.0.0.0:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2727:16)
    at Blaze._wrapCatchingExceptions (http://0.0.0.0:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1606:16)
    at Object.Spacebars.call (http://0.0.0.0:3000/packages/spacebars.js?7f53771c84a2eafac2b561c9796dda0d8af8e7f5:171:18)
    at http://0.0.0.0:3000/packages/msavin_mongol.js?558950870b2ec9c51c4caac919a2ca3b3e8b6a76:467:24
    at null.<anonymous> (http://0.0.0.0:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2472:44)
    at http://0.0.0.0:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1808:16
    at Object.Blaze._withCurrentView (http://0.0.0.0:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2043:12)
    at viewAutorun (http://0.0.0.0:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1807:18)

An instance of the Orders collection has an array in it like this:

{
    lineItems: []
}

I use a transform function which puts a reference to the Order itself in each of the lineItems in that array. I either need a way to prevent Mongol from using transformed-objects, or a way to delete that reference before Mongol attempts to use the objects for display.

Can't export package variables with debugOnly:true

This is not a Mongol specific issue, but it has an effect on what I want to do to.

I'd like to be able to export Mongol, so that users can have a little API to modify Mongol's behaviour. e.g.

Mongol.beforeInsert = function() { ... };
Mongol.hideCollection("posts");

But whether we want to or not, we can't export Mongol, because in debug mode, the only thing that gets exported to the global scope is Packages['msavin:Mongol'].Mongol but not plain Mongol. So we can provide an API if devs are willing to interact with that object.

We could do it through dedicated session keys, which has the advantage that devs don't really have to think about development/production environments -- just drop Session.set('Mongol_hideCollections',['posts','comments']) into the code and forget about it. Of course there will be a few random Session keys in production apps that do nothing, but that's not a big deal.

Thoughts?

<pre> background-color

Solved problem with pre background-color being white by adding:

MongoInspector pre {background-color: #222222;}

Could perhaps be specified as part of the Session.set
Nice tool !

Does Mongol work with Autoform / Collection2

I am running into errors with Mongol with updating, etc.

Here is the test project:

git clone https://github.com/yogiben/meteor-starter.git
meteor add msavin:mongol

I can see mongol but then editing posts, etc doesn't work

Scrollbars?

It looks really nice man.

Why do you have this set to scroll? Shouldn't it be hidden? I'm getting an empty scrollbar on the UI and I'm using Chrome (on a Ubuntu 14.04 machine).

Does not work with Meteor.users

I have this working for the collections I have created, but it does not work for Meteor.users, throws this client error.

Error: Exception in template helper:
TypeError: Cannot read property 'find' of undefined
    at String.Template.MongoInspector_collection.helpers.collectionCount (collection.js:43)
    at bindDataContext (lookup.js:26)
    at Blaze._wrapCatchingExceptions (exceptions.js:51)
    at Object.Spacebars.call (spacebars-runtime.js:130)
    at Template.MongoInspector_collection.HTML.DIV.HTML.DIV.Blaze.If.HTML.SPAN.class (collection.html:15)
    at null.<anonymous> (builtins.js:49)
    at view.js:179
    at Object.Blaze._withCurrentView (view.js:414)
    at viewAutorun (view.js:178)
    at Tracker.Computation._compute (tracker.js:263)

I can run Meteor.users.find({}) in the browser console without issue.

Conflict with ongoworks:security package

i've just added the mongol package, while having the security package in the project

the app crashes with this error:

Error: The collections argument must be a Mongo.Collection instance or an array of them
W20150311-11:02:18.428(2)? (STDERR)     at SecurityRuleConstructor.Security.Rule.collections (packages/ongoworks:security/security-api.js:45:1)
W20150311-11:02:18.428(2)? (STDERR)     at [object Object].Mongo.Collection.permit (packages/ongoworks:security/security-api.js:101:1)

this is caused when I'm trying to apply permissions to the Meteor users collection

any thoughts?

Duplicating Documents which have been wrapped with additional methods...

seems to lead to an error.

The issue seems to be that the "duplicate" - code runs through all the objects' properties as returned by Collection.find() . But unfortunately I wrap those with a class and additional methods using meteors' "transform" - function.

As I don't see the functions and additional data fields added by the constructor in the json for updating the documents via mongol I think that there might be another way / maybe a way to skip the transform-function?

Best wishes

Daniel

Mongol doesn't play nicely with GroundDB

Trying to add mongol to an app with GroundDB results in an error:

W20150309-18:20:14.048(1)? (STDERR)           
W20150309-18:20:14.050(1)? (STDERR) /home/alex/.meteor/packages/meteor-tool/.1.0.41.yumiah++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150309-18:20:14.051(1)? (STDERR)                                             throw(ex);
W20150309-18:20:14.051(1)? (STDERR)                                                   ^
W20150309-18:20:14.108(1)? (STDERR) Error: use "new" to construct a Mongo.Collection
W20150309-18:20:14.108(1)? (STDERR)     at new Mongo.Collection (packages/mongo/collection.js:29:1)
W20150309-18:20:14.109(1)? (STDERR)     at new Ground.Collection (packages/ground:db/groundDB.server.js:80:1)
W20150309-18:20:14.109(1)? (STDERR)     at app/lib/collections.js:2:9
W20150309-18:20:14.109(1)? (STDERR)     at app/lib/collections.js:4:3
W20150309-18:20:14.109(1)? (STDERR)     at /home/alex/test/.meteor/local/build/programs/server/boot.js:205:10
W20150309-18:20:14.109(1)? (STDERR)     at Array.forEach (native)
W20150309-18:20:14.109(1)? (STDERR)     at Function._.each._.forEach (/home/alex/.meteor/packages/meteor-tool/.1.0.41.yumiah++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150309-18:20:14.109(1)? (STDERR)     at /home/alex/test/.meteor/local/build/programs/server/boot.js:116:5
=> Exited with code: 8

Perhaps I'm doing something wrong? Or should I open this bug with @GroundMeteor instead?

Can't copy the _id

Kind of a minor thing - I like to copy and paste the _id of things - it seems after I updated I can't do this any more (have to click "Update" then I can copy it)

(Great package btw)

Search feature in Mongol

Is it possible to have some kind of querying feature in Mongol so that if your database is thousands of documents large, you can still easily find what you're looking for?

Suggestion: remove display none on by default on small screens

Im developping a mobile app and in my setup I use a small screen by default , and #MongoInspector has display:none on screens <768px.

woudl be nice to be able to initiate that on Session.set Mongol

Love the package!!

This is great to check you pub/sub on different pages!!

CSS glitches

Hi Max!

I see some CSS glitches. Probably, they are conflicts with my App's CSS.

On the first image the Duplicate and Remove buttons are off. I see this issue in Chrome for MAC but not in Safari.
On the second image, you'll see that text is white when I hit Update button.

I'll try to troubleshoot these issues and let you know.

screen shot 2015-02-20 at 12 00 25 am
screen shot 2015-02-20 at 12 00 36 am

mongol fails to load due to incompatibility with u2622:persistent-session

Uncaught ReferenceError: EJSON is not defined reporters.js?1426735142249:67

Not sure who gets the blame here but I'm going to guess gwendall:session-json might be involved since it's a related package that's installed by mongol.

Found this during Max's presentation at tonight's South Bay Meteor meetup.

Session Inspector showing Mongol sessions

I like your Session Inspector, but it shows the Mongol sessions in it.
screen shot 2015-03-05 at 12 00 32 am

Can we disable this or prevent Session Inspector from showing these? Better yet: wrap Session Inspector into Mongol!

Mongol prevents Accounts-UI from working normally.

Not sure if this is actually a bug, but if you have Mongol visible/open, it prevents other Accounts-UI dialogs from working.

I had Mongol showing, tried to login/create a user in my app using the normal dialog on my app's navbar and it kept rejecting any attempts, citing 'invalid email'. This apparently occurs when there are multiple instances of {{> loginButtons }} on one page, or something.

Mongol doesn't see all the documents in all my collections.

For instance. I have two users and it own sees one. I have another collection that shows zero documents even thought it has documents which can be found using meteor mongo in the terminal.

I probably misunderstood the instructions after you upgraded to automatic recognition of collections. I set the Session.Mongol object to undefined to undo ny original Session settings. I have tried to remove and re-add Mongo several times without a solution. So, in summary, Mongol sees all my collections but not all my documents. Two of the collections that it began to see after I set Session.Mongol to undefined do not see new documents when they are added.

Issues with aldeed:simple-schema

I get the error "TypeError: Object [object Object] has no method 'attachSchema'" attaching to Meteor.user while using aldeed:simple-schema and msavin:mongol together.

"This application contains Mongol" is annoying

Thanks for awesome tool, but is it so nessesary to log this??
I like clean console and want see there errors only, or my debug info. Maybe some parameter in with Session would turn this off?

Windows 7(64bit) Chrome Browser Meteor windows (official version)

I am new to the whole environment - so I may be missing something obvious.
I get the message this app contains Mongol - however the app is not visible on screen.
Control + M does not work.
If I enter command to display mongol, it pops up on screen and says a collection not available. If this an error - report it on git hub.
So here is the report.
Let me know if you need more info.

Thanks in advance - looks like a great utility.

Get an Exception - Cannot read property 'find' of undefined

Here is my mongol config... I dont know why it is getting undefined.

if (Meteor.isClient) {
Session.set("Mongol", {
'collections': ['Posts'],
'display': true,
'opacity_normal': ".7",
'opacity_expand': ".9",
'disable_warning': "false"
});
}

1.0.2 March 13th, 2015 installed

TypeError: Cannot read property 'find' of undefined
at null. (http://localhost:3000/packages/babrahams_editable-json.js?1047754ffc6951042e6ae766224ac96170c70dc1:560:27)
at http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1808:16
at Object.Blaze._withCurrentView (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2043:12)
at viewAutorun (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1807:18)
at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:296:36)
at new Tracker.Computation (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:214:10)
at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:487:11)
at Blaze.View.autorun (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1806:19)
at Blaze.TemplateInstance.autorun (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:3116:20)
at Template.editableJSON.created (http://localhost:3000/packages/babrahams_editable-json.js?1047754ffc6951042e6ae766224ac96170c70dc1:558:10)

Issue inserting and updating documents with SimpleSchema

Returns the following error when trying to insert or update documents:

I20150226-13:31:39.137(-8)? Exception while invoking method 'Mongol_insert' ReferenceError: SimpleSchema is not defined
I20150226-13:31:39.137(-8)? at Meteor.methods.Mongol_insert (packages/msavin:mongol/server/methods.js:84)
I20150226-13:31:39.138(-8)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1599)
I20150226-13:31:39.138(-8)? at packages/ddp/livedata_server.js:648
I20150226-13:31:39.138(-8)? at _.extend.withValue (packages/meteor/dynamics_nodejs.js:56)
I20150226-13:31:39.138(-8)? at packages/ddp/livedata_server.js:647
I20150226-13:31:39.138(-8)? at _.extend.withValue (packages/meteor/dynamics_nodejs.js:56)
I20150226-13:31:39.139(-8)? at _.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646)
I20150226-13:31:39.139(-8)? at packages/ddp/livedata_server.js:546

Commented out the code to publish the new changes.

cc: @JackAdams @krawalli

Idea: See all publications and subscribe on them by clicking on one

Forgetting to the subscribe to published data (or the other way around) is an easy mistake to make. It would be nice if Mongol could show us a list of publications and allows us to subscribe to them as easy as clicking on them.

Here're some things that might be good place to start:

On the server there is a list of publications, here:

Meteor.server.publish_handlers

example:

{ 
meteor_autoupdate_clientVersions: [Function],
meteor.loginServiceConfiguration': [Function],
favorites: [Function],
favoritesByUser: [Function],
comments: [Function],
commentsByDoc: [Function],
commentsByUser: [Function],
notifications: [Function],
seoByRouteName: [Function],
adminCollection: [Function],
adminAuxCollections: [Function],
adminUsers: [Function],
adminUser: [Function],
'app-data': [Function],
user: [Function],
users: [Function],
admin_collections_Beacons: [Function],
admin_collections_Rooms: [Function],
admin_collections_POIs: [Function],
admin_collections_Themes: [Function],
admin_collections_Users: [Function] }

To accommodate handlers that take arguments, a dialog could be presented allowing the user to enter some params.

The function source is accessible via .toString() and the arguments could be extracted using this method used by Angular.

Auto-detect collections, so it's just plug-and-play with no configuration

No need for the config setup step - just make it plug-and-play, using a default config. Devs can put in their own custom config if they want to.

Use the (very lightweight) (dburles:mongo-collection-instances package.

By default you get all the collections (including namespaced ones) in Mongol. If someone only wants a subset of the collections, they can Session.set("Mongol", {collections: [ ... ], ... }) as usual.

Happy to put a PR together once there's a repo I can fork.

Collection can't be found : "Uncaught TypeError: Cannot read property 'find' of undefined"

First of all thank you for this great package!

Issue:

Package cannot find collection if name of collection is not equal to the name of holding variable.
Example:

// doesn't work
Collection = {};
Collection.a = new Meteor.Collection( 'a'); 

// OR 

// doesn't work
A = new Meteor.Collection( 'a'); 

// will work
A = new Meteor.Collection( 'A');
a  = new Meteor.Collection( 'a');

I assume that you are trying to find collection by name using : window[name]

There is package which can help to find the collection by name:
https://github.com/dburles/mongo-collection-instances/

Hopefully it should solve the problem :
Mongo.Collection.get('name)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.