Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7166507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:30+00:00 2026-05-28T14:25:30+00:00

I am putting entities (as a datastore.PropertyList ) into the datastore like this: //

  • 0

I am putting entities (as a datastore.PropertyList) into the datastore like this:

// save one
var plist datastore.PropertyList = make(datastore.PropertyList, 3)
plist = append(plist, datastore.Property { "name", "Mat", false, false })
plist = append(plist, datastore.Property { "age", "29", false, false })
plist = append(plist, datastore.Property { "location", "London", false, false })
key := datastore.NewIncompleteKey(context, "Record", nil)
datastore.Put(context, key, &plist)

// save another one
var plist datastore.PropertyList = make(datastore.PropertyList, 3)
plist = append(plist, datastore.Property { "name", "Laurie", false, false })
plist = append(plist, datastore.Property { "age", "27", false, false })
plist = append(plist, datastore.Property { "location", "London", false, false })
key := datastore.NewIncompleteKey(context, "Record", nil)
datastore.Put(context, key, &plist)

That all works fine (although the code above is more like pseudo code for now). I am able to load them individually, and the datastore.PropertyList comes out with each field as its own datastore.Property.

However, when I try to retrieve many of them using a Query, it fails:

query := datastore.NewQuery("Record")

plists := make(datastore.PropertyList, 0, 10)
keys, err := query.GetAll(context, &plists)

I get the following error:

datastore: cannot load field "age" into a "datastore.Property": no such struct field

It seems that it doesn’t complain about Name because that happens to be a valid property of datastore.Property, so how do I get it to load the items as intended, with each item in plists being a datastore.PropertyList instead of datastore.Property?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:25:31+00:00Added an answer on May 28, 2026 at 2:25 pm

    I changed the implementation to use the PropertyLoadSaver interface – you can see it working nicely in our new Active Record style wrapper for datastore: http://github.com/matryer/gae-records (see the record.go type’s Load and Save methods)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a loop where I put a lot of entities into the datastore,
I have putting such data into LinearView. as like below code: public void showResult()
Putting two dashes on a page sometimes, like this -- in rare occassions messes
I have one application which uses NHibernate to save entities to a database, and
Putting this at the top of your CSS file: * { margin: 0; padding:
Update Putting this at the top because it is crazy :) So some users
I like putting shortcuts of the form g - google.lnk in my start menu
I've been putting a lot of thought into procedural generation of content for a
Putting this line to view.phtml ... <?php echo $this->getChildHtml('upsell_products') ?> ... raises this error:
Putting aside whether the use of isinstance is harmful , I have run into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.