{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angularfire2/issues/679","repository_url":"https://api.github.com/repos/angular/angularfire2","labels_url":"https://api.github.com/repos/angular/angularfire2/issues/679/labels{/name}","comments_url":"https://api.github.com/repos/angular/angularfire2/issues/679/comments","events_url":"https://api.github.com/repos/angular/angularfire2/issues/679/events","html_url":"https://github.com/angular/angularfire2/issues/679","id":189260824,"number":679,"title":"Query a FirebaseListObservable and then push a new element","user":{"login":"mquentin","id":6943103,"avatar_url":"https://avatars.githubusercontent.com/u/6943103?v=3","gravatar_id":"","url":"https://api.github.com/users/mquentin","html_url":"https://github.com/mquentin","followers_url":"https://api.github.com/users/mquentin/followers","following_url":"https://api.github.com/users/mquentin/following{/other_user}","gists_url":"https://api.github.com/users/mquentin/gists{/gist_id}","starred_url":"https://api.github.com/users/mquentin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mquentin/subscriptions","organizations_url":"https://api.github.com/users/mquentin/orgs","repos_url":"https://api.github.com/users/mquentin/repos","events_url":"https://api.github.com/users/mquentin/events{/privacy}","received_events_url":"https://api.github.com/users/mquentin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-14T23:56:47Z","updated_at":"2016-11-15T00:34:46Z","closed_at":"2016-11-15T00:34:46Z","body":"Hello,\r\n\r\nI am trying to querry a FirebaseListObservable : \r\n\r\n`let objectList= this.af.database.list('/myObjects', {`\r\n`                query: {`\r\n`                orderByChild: 'title',`\r\n`                equalTo: 'TEST'`\r\n`            }`\r\n`        });`\r\n\r\nAnd then, if this objectList is empty, I add a new object with a title='TEST' :     \r\n\r\n`objectList.subscribe(`\r\n`snapshot => {`\r\n`            if(null != snapshot && snapshot.length === 0){`\r\n`                 this.af.database.list('/myObjects')`\r\n`.push({title:'TEST', content:'my content...'});`\r\n`            }`\r\n`});`\r\n\r\nWhen my list is empty, it does work but I already an Object with the title === 'TEST', I receive a first snapshot empty (so a new object with a title='TEST' is created) and then I receive the snapshot which is not empty...\r\n\r\nI guess the problem comes from the Observable that I am updating within its own .subscibe... However, I do not find any other solution.\r\n"}}
{"actor":{"display_login":"mquentin"}}