Как обновить ключ свойства в базе данных релейного времени firebase, используя angular 7 - PullRequest
1 голос
/ 14 мая 2019

Я пытаюсь отредактировать ключ свойства в моей базе данных firebase, который мне не удался. Возможно ли это?

1 Ответ

0 голосов
/ 14 мая 2019
    Updating and Deleting Todos
    To update or delete a todo, things are a bit different because you’ll need a reference to the todo item that is to be updated or deleted. This can be done with AngularFireDatabase.object. Objects inside a Firebase have a unique key available as $key:

    Updating Todos
    Here’s how you would toggle the completed state of a todo:

    toggleDone(todo: any): void {
      this.af.object('/todos/' + todo.$key)
        .update({ content: todo.content, done: !todo.done });
    }
    Or update its content:

    updateTodo2(todo: any, newValue: string): void {
      this.af.object('/todos/' + todo.$key)
        .update({ content: newValue, done: todo.done });    
    }

for more details goto 
https://alligator.io/angular/firebase-crud-operations/
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...