You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "James Cash (JIRA)" <ji...@apache.org> on 2010/01/30 23:51:34 UTC
[jira] Created: (COUCHDB-635) A document with a field named
'constructor' causes it to silently be excluded from any and all map views
A document with a field named 'constructor' causes it to silently be excluded from any and all map views
--------------------------------------------------------------------------------------------------------
Key: COUCHDB-635
URL: https://issues.apache.org/jira/browse/COUCHDB-635
Project: CouchDB
Issue Type: Bug
Components: JavaScript View Server
Affects Versions: 0.10.1
Environment: Mac OS X 10.6.2, CouchDB 0.10.1
Reporter: James Cash
Priority: Minor
If a document has a (nested) field named 'constructor', any map which attempts to emit the document will instead silently discard it.
For example, the document
{ "_id": "CSC190H1S",
"_rev": "32-287eec55e59305ee94129a0be940bf41",
"outcomes": {
"constructor": [
"knowledge"
]
}
}
will silently be excluded by any view which attempts to emit "doc" or "doc.outcomes" .
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-635) A document with a field named
'constructor' causes it to silently be excluded from any and all map views
Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Joseph Davis updated COUCHDB-635:
--------------------------------------
Skill Level: New Contributors Level (Easy)
> A document with a field named 'constructor' causes it to silently be excluded from any and all map views
> --------------------------------------------------------------------------------------------------------
>
> Key: COUCHDB-635
> URL: https://issues.apache.org/jira/browse/COUCHDB-635
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: Mac OS X 10.6.2, CouchDB 0.10.1
> Reporter: James Cash
> Priority: Minor
>
> If a document has a (nested) field named 'constructor', any map which attempts to emit the document will instead silently discard it.
> For example, the document
> { "_id": "CSC190H1S",
> "_rev": "32-287eec55e59305ee94129a0be940bf41",
> "outcomes": {
> "constructor": [
> "knowledge"
> ]
> }
> }
> will silently be excluded by any view which attempts to emit "doc" or "doc.outcomes" .
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-635) A document with a field named
'constructor' causes it to silently be excluded from any and all map views
Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806803#action_12806803 ]
Chris Anderson commented on COUCHDB-635:
----------------------------------------
when 0.11 is released (next week I hope) the new JSON handler should make it in there which should have this issue.
For now I suggest deleting the offending doc or changing the names.
I'm unable to reproduce on trunk.
If you do try trunk, please be aware that you might not be able to downgrade your file to 0.10 afterwards so you want to use a copy of your data.
> A document with a field named 'constructor' causes it to silently be excluded from any and all map views
> --------------------------------------------------------------------------------------------------------
>
> Key: COUCHDB-635
> URL: https://issues.apache.org/jira/browse/COUCHDB-635
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: Mac OS X 10.6.2, CouchDB 0.10.1
> Reporter: James Cash
> Priority: Minor
>
> If a document has a (nested) field named 'constructor', any map which attempts to emit the document will instead silently discard it.
> For example, the document
> { "_id": "CSC190H1S",
> "_rev": "32-287eec55e59305ee94129a0be940bf41",
> "outcomes": {
> "constructor": [
> "knowledge"
> ]
> }
> }
> will silently be excluded by any view which attempts to emit "doc" or "doc.outcomes" .
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-635) A document with a field named
'constructor' causes it to silently be excluded from any and all map views
Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806759#action_12806759 ]
Paul Joseph Davis commented on COUCHDB-635:
-------------------------------------------
I can't seem to trigger any sort of weirdness using json2.js and couchjs. Do you have any log output when you try and emit that?
For reference:
//test.js
print(JSON.stringify({"constructor": "foo"}));
var p = JSON.parse("{\"constructor\": \"foo\"}");
print(p);
print(JSON.stringify(p));
print(JSON.stringify({"foo": {"constructor": "baz"}}));
cat test.js | ./src/couchdb/priv/couchjs
Produces:
{"constructor":"foo"}
[object Object]
{"constructor":"foo"}
{"foo":{"constructor":"baz"}}
As expected.
> A document with a field named 'constructor' causes it to silently be excluded from any and all map views
> --------------------------------------------------------------------------------------------------------
>
> Key: COUCHDB-635
> URL: https://issues.apache.org/jira/browse/COUCHDB-635
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: Mac OS X 10.6.2, CouchDB 0.10.1
> Reporter: James Cash
> Priority: Minor
>
> If a document has a (nested) field named 'constructor', any map which attempts to emit the document will instead silently discard it.
> For example, the document
> { "_id": "CSC190H1S",
> "_rev": "32-287eec55e59305ee94129a0be940bf41",
> "outcomes": {
> "constructor": [
> "knowledge"
> ]
> }
> }
> will silently be excluded by any view which attempts to emit "doc" or "doc.outcomes" .
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-635) A document with a field named
'constructor' causes it to silently be excluded from any and all map views
Posted by "James Cash (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806762#action_12806762 ]
James Cash commented on COUCHDB-635:
------------------------------------
Sure,I try to run the following map:
function(doc) {
if (doc._id == 'CSC190H1S') {
emit([doc._id], doc.activities.L02.outcomes);
}
}
where the doc in question resembles:
{ "_id": "CSC190H1S",
"_rev": "34-b3a5079ea3f7818534426991a8d11907",
"activities": {
"L02": {
"outcomes": {
"constructor": [
"knowledge"
] } } }
The log contains the following entry:
[Sun, 31 Jan 2010 00:37:48 GMT] [info] [<0.19833.3>] OS Process :: function raised exception (TypeError: toJSON.dispatcher[val.constructor.name] is not a function) with doc._id CSC190H1S
> A document with a field named 'constructor' causes it to silently be excluded from any and all map views
> --------------------------------------------------------------------------------------------------------
>
> Key: COUCHDB-635
> URL: https://issues.apache.org/jira/browse/COUCHDB-635
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: Mac OS X 10.6.2, CouchDB 0.10.1
> Reporter: James Cash
> Priority: Minor
>
> If a document has a (nested) field named 'constructor', any map which attempts to emit the document will instead silently discard it.
> For example, the document
> { "_id": "CSC190H1S",
> "_rev": "32-287eec55e59305ee94129a0be940bf41",
> "outcomes": {
> "constructor": [
> "knowledge"
> ]
> }
> }
> will silently be excluded by any view which attempts to emit "doc" or "doc.outcomes" .
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.