RethinkDB: How to iterate over every single row in a table - rethinkdb

I am creating an ldapjs server to provide an LDAP interface to users stored in a ReactiveDB. When a 3rd-party app performs an LDAP search for users, I want to iterate over all rows in a RethinkDB users table and send them in LDAP form.
According to the RethinkDB docs, r.table('users').getAll() will return nothing.
It seems like I might be able to do r.table('users').filter(() => true) but that would be a hack.
Is RethinkDB trying to discourage getting all rows? Unfortunately that's just what I need so that OwnCloud can sync in all of the available users via its LDAP Auth Backend.

I figured it out, simply using r.table('users') returns all documents in the table according to https://www.rethinkdb.com/api/javascript/table/. Filtering options chained after table() are not required.

Related

DynamoDB Appsync Query on multiple attributes

My app uses AppSync resolvers to fetch data from DDB and return it to our front-end. One table we have is for Notifications. A Notification can be either pending or default (non-pending). The table itself has a primary key of notification_id and we have a GSI called userIndex to grab the notifications for a user, with a sort key of timestamp.
In the app, I show all notifications in a list, pending first and then default. Given that a user may have many notifications, I'd like to implement pagination to fetch a batch at a time. The only way I've been able to do this is to
change the query to include a isPending parameter, which I use as a filter expression for the query to only return notifications that are isPending or isNotPending.
Store two "nextTokens", one for each isPending and isNotPending, along with corresponding lists.
Make separate queries for pending/non-pending, and use the filter to return to the appropriate list.
This is obviously inefficient and I am re-reading data from DynamoDB. My question is, given my DynamoDB table/requirements, is there a way I can paginate so that I can get all the pending notifications first (sorted by timestamp) and then all the default notifications next (sorted by timestamp) by using one query and one nextToken
I've seen the use of #model and #key, but I haven't been able to make it work in my app.
Thanks!
No, not really. There is a hard limit on returns for a Dynamodb query - and that cannot be bypassed. the only way to make use of nextToken is another query.
However, it is also worth noting that the FilterExpression happens after the data has already been retrieved and is filtered client side. It does not reduce the documents pulled from the query - only whats displayed. So the next token is still going to be (relatively) the same for each query. You can instead filter it yourself after the call before the next pagination query and save yourself a little bit in terms of multiple calls.

Assigned to field in Case Table- Servicenow

In Case Form,Based on the group selected in Assignment group field ,the assigned to field is listing some users which belongs to it in CRM UI.
Now I want to retrieve the same users using normal REST API. Please suggest REST API to list the users based on a group.
Users linked to groups is stored in table sys_user_grmember. In the example I search for all Users in Group named "Application Development".
GET https://YOURINSTANCE.service-now.com/api/now/table/sys_user_grmember?sysparm_query=%22groupSTARTSWITHApplication%20Development%22&sysparm_limit=10
You can easily test the REST Api with the rest api explorer from SNOW: https://YOURINSTANCE.service-now.com/nav_to.do?uri=%2F$restapi.do
Can you give more info on the exact requirement, so i can be more precise?
As far as I know, you can create a rest message to get the users inside a group and show the list wherever you want.
This would require three things from your side.
a) Creating a rest message in Snow.
b) Creating a script includes calling the rest message.
c) A client script or trigger which initiates the rest call using client script.
Hope this helps.
Regards.

unable to get values from PER_ASSIGNMENT_SECURED_LIST_V table?

I am working in oracle hcm fusion application. Writing a extract rule for a batch loader fast formula. in one of the extract rule formula i am using a DBI PER_HIST_ASG_ASSIGNMENT_NUMBER but it returning 0, that is no values in DBI. The problem is the DBI internally refer a secured view PER_ASSIGNMENT_SECURED_LIST_V. If I query this table from BI publisher I am not getting any rows. Some one suggest that Data role is missing. Can anyone tell me what is the exact datarole that I should add to acces the values from that DBI.
This View is based on security profile added in the Employment like BU,Department,Location etc.
So you try to retrieve the records from a Super User or Implementation user which is not attached any security profile, You will get the results.
Data roles are configured differently for each organization that is using the Cloud.
So you have to check with your application security consultant for the exact data role you need for this table.

How to associate row with a user in Parse.com?

How to create a column in parse.com such that I can associate each row with a particular user? Also how to protect each row with the user so that others can not perform data modification on that particular row?
For most purposes, you want a Pointer column to the user.
For securing your data to that particular user, you'll want to look at object-level access control. You should be able to find most of what you need in the guide: https://parse.com/docs/ios/guide#security-object-level-access-control
(There are also similar guides for JS and Android)
Per this link: https://parse.com/questions/data-unique-to-user on the parse site, add a column that is a User to the table you want associate. Then use Parse.user.currentUser() to set that value.

Solr order by field not in document

Just wondering if what I want to do is possible with Solr:
I have a Solr index of 'Users' [id, name, join_date] and on my site and I have a page /users which has a Solr query that lists all of the users in the index in alphabetical order.
On my site users can 'follow' other users. I have added another page /followers which first gets all the user_ids which are 'following' the logged in user from MySQL - then uses these IDs to query Solr to only return users which the current user is following.
This all works fine.
But the problem is, I'd like to be able to order the users returned on /followers in order of when they first started following the logged in user - I keep this information in a join table in MySQL. But my Solr documents don't contain this date - as obviously one user can have many followers and vise versa. Also I can't just use MySQL to server this page as I need to keep it Solr query-able.
Would love some insight into this - it's been bugging me for a while now.
you can do that with ExternalField but you need to export your info from the db to a text file (and keep it updated etc).
This guy here discusses a way to do it without ExternalField, but requires customizing Sorl code.

Resources