在firebase中向子项内的子项添加数据

时间:2018-03-03 15:06:39

标签: android firebase-realtime-database

week data

我可以通过执行以下操作来更新地址和说明等数据:

      <form method="post" action="shareholder" role="form"   id="vehicle_form" name="vehicle_form" data-parsley-validate novalidate>

     <div id="success_msg" class="alert alert-success alert-dismissable">  </div>
        <input type="hidden" name="_token" value="{{csrf_token()}}">
         <input type="text" name="name" id="vehicle_no"  value="" placeholder="Enter Your Name" class="form-control">
         <input type="text" name="email" id="vehicle_no" value="" placeholder="Enter your Email" class="form-control">
         <input type="text" name="password" id="vehicle_no" value="" placeholder="Enter your Password" class="form-control">
        <input type="submit" value="REGISTER">
      </form>

但是如何添加周? Week有五个孩子,就是几天。在每个孩子中,我想要一个整数或字符串数​​组。我尝试了与上面相同的方式,但它似乎没有工作。以上方法仅适用 for key:value。

2 个答案:

答案 0 :(得分:1)

你应该创建一个POJO模型“Week”,它对应于你想要的节点结构,然后创建这个对象类的实例并推进Firebase

请参阅此tutorial

答案 1 :(得分:1)

这周是嵌套的import pandas as pd class ColumnCalculation: """This houses the functions for all the column manipulation calculations""" @staticmethod def total_electricity(): """Calculates the total amount of electricity used per year""" df = pd.read_csv("2011-onwards-city-elec-consumption.csv", thousands=',') df.set_index('Date', inplace=True) # Sets index to months df.loc['Total'] = df.sum() # Creates a new row for the totals of each year return print(df) # Prints the dataframe ,所以:

Map
相关问题