{"action":"created","issue":{"url":"https://api.github.com/repos/indexzero/nconf/issues/176","labels_url":"https://api.github.com/repos/indexzero/nconf/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/indexzero/nconf/issues/176/comments","events_url":"https://api.github.com/repos/indexzero/nconf/issues/176/events","html_url":"https://github.com/indexzero/nconf/issues/176","id":97947062,"number":176,"title":"Hierarchy interrupted by nconf.use()","user":{"login":"RobertHerhold","id":8069753,"avatar_url":"https://avatars.githubusercontent.com/u/8069753?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertHerhold","html_url":"https://github.com/RobertHerhold","followers_url":"https://api.github.com/users/RobertHerhold/followers","following_url":"https://api.github.com/users/RobertHerhold/following{/other_user}","gists_url":"https://api.github.com/users/RobertHerhold/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertHerhold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertHerhold/subscriptions","organizations_url":"https://api.github.com/users/RobertHerhold/orgs","repos_url":"https://api.github.com/users/RobertHerhold/repos","events_url":"https://api.github.com/users/RobertHerhold/events{/privacy}","received_events_url":"https://api.github.com/users/RobertHerhold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-29T14:20:26Z","updated_at":"2015-12-27T07:08:29Z","closed_at":null,"body":"From the README: '**The order in which you attach these configuration sources determines their priority in the hierarchy**'\r\n\r\nSo therefore, if I have 3 configuration stores, a, b, and c, and I arrange them so a overrides b which overrides c:\r\n```\r\nnconf.add(a)\r\nnconf.add(b)\r\nnconf.add(c)\r\n```\r\n\r\nNow suppose I want to replace configuration b with another source. I would want to use:\r\n```\r\nnconf.use('b', {\r\n        type: 'literal',\r\n        store: mystuff\r\n    }\r\n```\r\nor something like that. However, what happens is that store b is [removed](https://github.com/indexzero/nconf/blob/master/lib/nconf/provider.js#L107) and [re-added](https://github.com/indexzero/nconf/blob/master/lib/nconf/provider.js#L110), which effectively makes this the hierarchy: \r\n\r\n* a\r\n* c\r\n* b\r\n\r\nrather than\r\n* a\r\n* b\r\n* c\r\n\r\nas you would expect it to be."},"comment":{"url":"https://api.github.com/repos/indexzero/nconf/issues/comments/167390475","html_url":"https://github.com/indexzero/nconf/issues/176#issuecomment-167390475","issue_url":"https://api.github.com/repos/indexzero/nconf/issues/176","id":167390475,"user":{"login":"ernoaapa","id":662535,"avatar_url":"https://avatars.githubusercontent.com/u/662535?v=3","gravatar_id":"","url":"https://api.github.com/users/ernoaapa","html_url":"https://github.com/ernoaapa","followers_url":"https://api.github.com/users/ernoaapa/followers","following_url":"https://api.github.com/users/ernoaapa/following{/other_user}","gists_url":"https://api.github.com/users/ernoaapa/gists{/gist_id}","starred_url":"https://api.github.com/users/ernoaapa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ernoaapa/subscriptions","organizations_url":"https://api.github.com/users/ernoaapa/orgs","repos_url":"https://api.github.com/users/ernoaapa/repos","events_url":"https://api.github.com/users/ernoaapa/events{/privacy}","received_events_url":"https://api.github.com/users/ernoaapa/received_events","type":"User","site_admin":false},"created_at":"2015-12-27T07:08:29Z","updated_at":"2015-12-27T07:08:29Z","body":":+1: I bumped to this also!"}}