Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing with same filename but diff extension name cause conflict #216

Open
iblislin opened this issue Jan 11, 2016 · 4 comments
Open

Pushing with same filename but diff extension name cause conflict #216

iblislin opened this issue Jan 11, 2016 · 4 comments

Comments

@iblislin
Copy link
Collaborator

I was wondering to know why we remove extension from full filename when we do the filesystem-doc mapping.

e.g.
Assume we have foo.txt in our app dir.

└─[iblis@imfsa]% ls
_id      foo.txt
└─[iblis@imfsa]% couchapp push
└─[iblis@imfsa]% curl https://127.0.0.1:5984/test/_design/c | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   154  100   154    0     0    146      0  0:00:01  0:00:01 --:--:--   146
{
  "_id": "_design/c",
  "_rev": "23-6458dae7e817d6f8f05aebe1472d38ee",
  "foo": "i'm the foo.txt",
  "couchapp": {
    "signatures": {},
    "objects": {},
    "manifest": [
      "foo.txt"
    ]
  }
}

Then, let's create a foo.json:

└─[iblis@imfsa]% echo '{}' > foo.json
└─[iblis@imfsa]% couchapp push
2016-01-11 22:39:05 [WARNING] %(name)s is already in properties. Can't add (foo.txt)
└─[iblis@imfsa]% curl https://127.0.0.1:5984/test/_design/c | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   140  100   140    0     0    151      0 --:--:-- --:--:-- --:--:--   151
{
  "_id": "_design/c",
  "_rev": "24-cd3ec0f31649fa84359242d78da737c7",
  "foo": {},
  "couchapp": {
    "signatures": {},
    "objects": {},
    "manifest": [
      "foo.json"
    ]
  }
}

The foo.txt gone.... 😭

@benoitc
Copy link
Member

benoitc commented Jan 12, 2016

this is quite expected. you define a property here.... if you wanted to
keep the extension then it has to be an attachment.
On Mon, 11 Jan 2016 at 15:45, Iblis Lin notifications@github.com wrote:

I was wondering to know why we remove extension from full filename when we
do the filesystem-doc mapping.

e.g.
Assume we have foo.txt in our app dir.

└─[iblis@imfsa]% ls
_id foo.txt
└─[iblis@imfsa]% couchapp push
└─[iblis@imfsa]% curl https://127.0.0.1:5984/test/_design/c | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 154 100 154 0 0 146 0 0:00:01 0:00:01 --:--:-- 146
{
"_id": "_design/c",
"_rev": "23-6458dae7e817d6f8f05aebe1472d38ee",
"foo": "i'm the foo.txt",
"couchapp": {
"signatures": {},
"objects": {},
"manifest": [
"foo.txt"
]
}
}

Then, let's create a foo.json:

└─[iblis@imfsa]% echo '{}' > foo.json
└─[iblis@imfsa]% couchapp push
2016-01-11 22:39:05 [WARNING] %(name)s is already in properties. Can't add (foo.txt)└─[iblis@imfsa]% curl https://127.0.0.1:5984/test/_design/c | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 140 100 140 0 0 151 0 --:--:-- --:--:-- --:--:-- 151{ "_id": "_design/c", "_rev": "24-cd3ec0f31649fa84359242d78da737c7", "foo": {}, "couchapp": { "signatures": {}, "objects": {}, "manifest": [ "foo.json" ] }}

The foo.txt gone.... [image: 😭]


Reply to this email directly or view it on GitHub
#216.

@iblislin
Copy link
Collaborator Author

Oh, i see... i forgot the _attachements.

And...are there more docs about the doc-fs-mapping ? seems docs of couchkit do not contain more detail...

@benoitc
Copy link
Member

benoitc commented Jan 12, 2016

there was an MD file in the docs folder. I don't know where it's gone.

On Tue, Jan 12, 2016 at 2:10 PM Iblis Lin notifications@github.com wrote:

Oh, i see... i forgot the _attachements.

And...are there more docs about the doc-fs-mapping ? seems docs of
couchkit
http://couchdbkit.org/docs/storing_docs_and_designdocs_on_filesystem.html
do not contain more detail...


Reply to this email directly or view it on GitHub
#216 (comment).

@iblislin
Copy link
Collaborator Author

This one ?
https://github.com/couchapp/couchapp/tree/master/docs/design

I want to write more info on that page, and need more references...
Maybe i should read the code first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants