Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SyntaxError: missing ; before statement (shell):1
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gmail  
View profile  
 More options Jul 16 2012, 4:28 am
From: gmail <fly...@gmail.com>
Date: Mon, 16 Jul 2012 16:28:58 +0800
Local: Mon, Jul 16 2012 4:28 am
Subject: SyntaxError: missing ; before statement (shell):1

Hi everyone:
when I save data to the collection which name is number start , the mongo prompt "Mon Jul 16 16:16:44 SyntaxError: missing ; before statement (shell):1 ",
and my command is following:

PRIMARY> use testwhb
switched to db testwhb
PRIMARY> db.a.save({"test":"1"})
PRIMARY> db.1.save({"tet2":"1"})
Mon Jul 16 16:16:44 SyntaxError: missing ; before statement (shell):1
PRIMARY> show collections

Does it mongo limit the collection name start with number??

gmail


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
मैं एक भारतीय बेवकूफ हूँ  
View profile  
 More options Jul 16 2012, 4:32 am
From: "मैं एक भारतीय बेवकूफ हूँ" <iamanindianid...@googlemail.com>
Date: Mon, 16 Jul 2012 10:32:48 +0200
Local: Mon, Jul 16 2012 4:32 am
Subject: Re: [mongodb-user] SyntaxError: missing ; before statement (shell):1
http://www.mongodb.org/display/DOCS/Collections


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Steneker  
View profile  
 More options Jul 16 2012, 5:14 am
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Mon, 16 Jul 2012 02:14:50 -0700 (PDT)
Local: Mon, Jul 16 2012 5:14 am
Subject: Re: SyntaxError: missing ; before statement (shell):1

Hi,

You can use a collection name starting with a number, but the mongo JS
shell recognizes that as a beginning a variable rather than a collection
name so you need to quote it:

> db["1"].save({"test2":1});
> db["1"].find();

{ "_id" : ObjectId("5003d9c1c27f710e17072683"), "test2" : 1 }

> db.getCollection("1").find()

{ "_id" : ObjectId("5003d9c1c27f710e17072683"), "test2" : 1 }

Cheers,
Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gmz  
View profile  
 More options Jul 16 2012, 5:17 am
From: gmz <geng...@gmail.com>
Date: Mon, 16 Jul 2012 02:17:10 -0700 (PDT)
Local: Mon, Jul 16 2012 5:17 am
Subject: Re: SyntaxError: missing ; before statement (shell):1

Collection names should begin with letters or an underscore and may include
numbers; $ is reserved.

在 2012年7月16日星期一UTC+8下午4时28分58秒,Benk写道:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gmz  
View profile   Translate to Translated (View Original)
 More options Jul 16 2012, 5:20 am
From: gmz <geng...@gmail.com>
Date: Mon, 16 Jul 2012 02:20:07 -0700 (PDT)
Local: Mon, Jul 16 2012 5:20 am
Subject: Re: SyntaxError: missing ; before statement (shell):1

And I think the error message should be more clear

在 2012年7月16日星期一UTC+8下午5时17分10秒,gmz写道:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »