Comments (6)
can you show me the demo json string of your code?
from mongohub-mac.
Looks like it fails with any document with date in it..
Just tested it with a fresh db:
$ mongo
MongoDB shell version: 1.6.6-pre-
connecting to: test
use hubtest
switched to db hubtest
db.d.insert({'foo': 'bar', 'created': new Date()})
db.d.find()
{ "_id" : ObjectId("4d4032a1c4fbdf147d37f54a"), "foo" : "bar", "created" : "Wed Jan 26 2011 15:41:37 GMT+0100 (CET)" }
then I go to mongohub, 'find' all documents in hubtest.d,
edit it with the json editor and change bar to bar2
(I try to save it as:
{ "_id" : ObjectId( "4d4032a1c4fbdf147d37f54a" ),
"foo" : "bar2",
"created" : Date( "Wed Jan 26 15:41:37 2011" ) }
)
and I get the error:
Failure parsing JSON string near: ,
"creat
hope that helps..
from mongohub-mac.
Based on the introduction from mongo extended JSON type (http://mongodb.onconfluence.com/display/DOCS/Mongo+Extended+JSON), Date()'s parameter should be a timestamp integer not a string. I'll add a more convenient function to use string later.
from mongohub-mac.
I see..
The thing is that mongohub use text dates as default,
so if I open my document, do nothing and hit save it doesn't work..
I don't think it should be that way.
You should either make timestamp default or like you said a wrapper 'function' to edit the date string like you suggested.
thanks. like your work :)
from mongohub-mac.
mmm ... i've other issues, with this, too. i've tried with a timestamp, but it still won't save. i receive error messages like "assertion util/message.cpp:467", "connection died" and "DBClientBase::findOne: transport error" when i try to save edited JSON. would be a very useful feature, if it worked ...
UPDATE just noticed, that apparently it nevertheless saved my changes, even though it
throws these error messages ... strange ...
great feature btw. ...
from mongohub-mac.
Would like to request for a convenient function to insert date in string format just like in mongodb documentation: http://docs.mongodb.org/manual/reference/method/db.collection.insert/
E.g. new Date('Sep 04, 1927')
from mongohub-mac.
Related Issues (20)
- error opening connection on localhost
- Inaccurate record count while exporting data
- Crashes on '1970-01-01T00:00:00.000Z' date
- Query window resize issue HOT 3
- crashes on 10.9.2
- Add 'no longer maintained' to README.md and website, link to maintained version of software HOT 1
- The latest update to v 2.3.2 breaks an existing setup
- How do you ensureindex and set unique true? HOT 1
- Crash upon attempt to connect HOT 1
- [feature request] customizable keyboard shortcuts
- update document is corrupt or contains invalid keys including $ or .
- Can the client connect to remote mongo servers? HOT 1
- Authentication fails HOT 2
- "Import From Mysql Database"
- Can't connect HOT 4
- Crashes every time when querying a collection
- Please add Timezone in query results (date)
- Website is down (mongohub.todayclose.com) - 500 Server Error HOT 2
- MongoHub 2.5.14 Crash HOT 3
- Feature Request: Reload Document when Saving via Document Editor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongohub-mac.